I have done a Codeforces match after a long time today. I registered for the match in the morning but totally forgot about it, until 15 minutes before the contest. I'll describe my experience with each problem one by one.
Problem A
Problem statement was easy to understand. Thought about it for a few seconds. Wrote down the equation and figured that t = ceil(c*(a-b)/b). Checked for the sample cases, worked. So, coded it and submitted. It passed all pretests. Wow! (15 minutes into the contest)
Problem B
I understood that we should have two indexes(roughly?) which start from middle and move towards the extremes. And we print the value of those indexes. However, figuring out the best way to implement it and handling the boundary cases took me some time. I finally submitted my code for this and it passed all the pre-tests in first attempt. I checked my code once, couldn't find any bug. So, moving to next problem. [40 minutes into the contest]
Problem C
I guess I was sort of in a hurry, so I had to read this problem multiple times to understand what it asks us to do. When I finally understood the problem. I thought we will need to use stack to simulate the try-catch blocks. But as, I was diving into the code, I realised that there's a simpler way to compute the error message. While implementing the solution. I faced a couple of problems: - You can't use cin to get a line of code. You should use fgets/cin.getline OR something else. - I had one of the while's going into infinite loop (silly mistake:()
Finally I managed to have the working code for this idea and submitted. My code passed all the pre-tests again! [80 minutes into the contest]
Problem D
Consider the roots of equations k_i * x + b_i = 0 for each i. The slope of polyline changes only at these points. So, I was thinking of actualy computing the slope before and after these points (say compute slopes at x0+epsilon and x0-epsilon) . But I thought precision issues would not let my solution pass. Then I thought we can use pairs of k,b (after diving by each of k,b by gcd(k,b)) and maintain the sum of all the original ks and another map maintaining no. of. i's for which have same k,b (after diving by gcd). If for a value of k,b sum of ks is 0. It means that the slope of the line doesn't change before and after that specific value of x. I coded this idea, but It was failing on pre-test 6.
Problem E
I didn't have time to read.
I have seen that many people (200+) managed to pass the pre-tests for D, Also I have seen the solution of many top contestants. It seems that the solution is quite simple. Hoping that my rating doesn't decrease much :P
Thanks for reading my post!