http://mirror.codeforces.com/contest/145/submission/28183892
I keep missing Test Case #58 on this problem because my answer does not have enough elements. Does my program RTE before printing out the last 2 elements, or is my IO flawed in some way that prevents it from reading in the last few queries?
Please help, and thanks in advance! vamaddur
Why the downvote? I am asking a question for a PAST CONTEST not a CURRENT CONTEST. This is perfectly fine, so I see no reason to push the button.
People tend to downvote post that ask question(they think is not meaningful) that's why. I can assure you that if you are asking a question for a current contest, your downvote would be 3 digits. Anyway, the problem is the size of your stuff is too small. Increasing it will give you TLE on test 80. Here you go. 28189330
Further improving IO speed gives you AC. 28189632
Why does changing the size of "stuff" change the behavior of my code? The size is already 1000000, which is enough to hold any string that is given...
EDIT: Perhaps the newline character??? But why would this cause my code to miss two queries?
yes, it is the newline character, and that causes UB. So I don't know how it cause your code to miss 2 queries.
EDIT: I don't mean the newline, but the \0 character. Sorry, wasn't paying attention when I reply.