Problem: 1624F - Interacdive Problem. Submission: 191765637. I am testing test cases offline, my answers are correct. However test cases show wrong answer on the first case. And it doesn't even let me know what is wrong with my answer or what my output is. Who created these dogshit testcases
This is not my first interactive problem. I know how to solve them
Issue resolved. New Submission: 191766450 Turns out using "fflush(stdout)" wasn't enough. I had to manually add endl instead of "\n" after every line I printed to get my submission right, and also removed "sync_with_stdio(false)", don't know if that has any impact tho. I have never faced this type of issue with any other interactive problems before. Dogshit experience overall.
This problem probably got rated 2000R for that alone. Half of them couldn't figure out why they were getting wrong answer
You are not initializing variable
ans
in your code, so it can have any value (and that value can differ when you run your program locally and on the server). And in the first testans
's value isn't changing throughout the execution, because the answers of interactor are ascending, therefore there is a junk inans
after thewhile
cycle and the answer in first test can be wrong (and it is on the server, as you can see)