Solving Codeforces Goodbye 2023 problem A

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everybody this is AR here and today we are going to solve the question from ces.com um the first question from goodby 2023 contest uh problem a is called 2023 uh it's the ending contest uh for this year and uh let's check it out all uh I will put the problem Link in the video description but um as a quick review um we are going to give our program a set of inputs for example we say that for seven times we are going to keep our program and each time we say for example um I have had a l with four items which two of them are removed from and we know that the initial list the initial sequence of numbers U has uh the product of 2023 it means the multiplication of items in the Leist in the first place is equal 20 23 but then some of items are removed from and what we should do is to check whether is that possible to find those or not if it's possible uh we should print yes and uh print a set of possible uh numbers if not you simply print and all right let's uh print it let's uh go and write this in p open my V code my favorite editor I create new file file main first of all I'm going to get the input I write for example is uh T cases is equal to integer of then I'm going to repeat a loop for every item in test case so I write for T Test cases sorry in range of test cases in range of test cases I'm going to what's happened here okay for T range of test cases every time we should get an n and K from the so n and K are equal to map to integer from input dolit then uh what is n n is the number of items in list after some items are removed from them and K are the count of remove items okay then we should get the number of left it from so I create a list like numbers which is equal to uh list of a map to integer from input then I should check whether uh the what is the multiplication what is the product of all numbers in thises uh give me a second to give myself a break oh it's so hard pling by programming but this my personal routine so let's pick it up okay are numbers sorry I might do multiple times these breaks I want to find the product of all all items in the number okay I create a product which is equal to one and for each number for for example n in numbers what I do is that I write product is multip equal to now so now I have the product of all numbers inside this list then I check whether uh then I check whether the 2023 is dividable by this product or not so I check if 2023 divided by uh this product gives the thbe the remainder of zero then you should simply print a no but if it's not the case it means if the remainder is equal to zero we should print yes because we can create 2023 with all the numbers in this another break okay but then after that after printing the yes you should print the least of possible num so uh we find uh LIF for example numbers which is equal to 2023 integer divided by the product then we should print a list of numbers uh which can create the product of3 so I first of all print those left numbers and I leave the of the line empty and then for uh give me another break I'm hitting my maximum border of it train programing work couting okay I write for for example J in range of what in range of uh Kus one every time print a simple one print one or maybe space one with end of nothing and in the end we simply put an empty print to create new okay let's save this and upload this in the code forces I choose the file name that F from here let's subit the Cod for but I think it should be fine and it's accept all right guys uh this was R thank you for watching the video see you next up
Info
Channel: Arash Nemat Zadeh
Views: 122
Rating: undefined out of 5
Keywords: Arash Nemat Zadeh, Arashnm80, codeforces, goodbye 2023, plank, mrplank, plankgod, python, programming, programmer
Id: PBLGvorcEB4
Channel Id: undefined
Length: 9min 1sec (541 seconds)
Published: Thu Jan 04 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.