Saturday, January 16, 2016

UVA 10258 : Contest Scoreboard

This problem will always remind me how important it is to read the problem carefully. Very carefully. Most of the mistakes that I did could have been avoided, had I read the problem statement with patience.

Mistakes I did :
  1. I didn't read what was required in the output correctly. They asked for all those who have made a submission, I rather gave the output only for those contestants who made a correct submission.
  2. I didn't take care of the test case where the user will submit the correct output for the same problem more than once. I thought of it while starting to program, but then ignored it. Big mistake, indeed !

One mistake that I was going to do, was I didn't yet got what to do if user submits wrong answer after a correct submission. Guess what?! It was clearly mentioned what's needed to be done in the question itself. My first mistake saved me from this one.

I also learned a few new C++ features, namely, stable_sort, peek, get. I am yet to understand how to use stable_sort properly.

[5:57 PM] And yeah, I made another mistake just now. Foolish me!! Once again I have to say that I didn't read the problem properly because I missed the case that there is no penalty for unsolved problems. Damn it, it look a long time to correct this mistake.

I also got to know of stringstream, although I haven't used it yet.

Here is my solution for the same :

No comments:

Post a Comment