Reyna's submission of Problem A in today's contest got Wrong Answer verdict.As Reyna is very good at coding,I felt a little strange.However,when I looked at the detailed feedback,it showed that it couldn't find a file,which I never saw before.More strangely,I re-submitted Reyna's code and then got AC verdict.
So,could anyone tell me what the reason was or it was a bug in Codeforces? Thanks!
UPD: The issue is fixed now.
Auto comment: topic has been updated by Marco_L_T (previous revision, new revision, compare).
I do not think that it is valid for the main function not to return a value.
It is completely valid. I barely return a value for my main.
I suppose the judge had a bug, and it was solved, but his submission wasn't rejudged.
Auto comment: topic has been updated by Marco_L_T (previous revision, new revision, compare).
His solution has sorting but takes 15 ms whereas my solution does not include sorting but takes 30 ms.
Can someone explain why so that I can improve my solution ?
In my opinion,there isn't much difference between 15 ms and 30 ms,and they all mean a very fast solution.If you submit your code one more time,maybe you can get 15 ms or even 0 ms.
Thanks. Here's my submission. Please let me know if I did anything wrong and why it's taking the extra time or if it's just a bug.
Your solution is really an O(N) one and it's the best complexity that can be got on Problem A. As n<=100, the speed of an O(N) solution and an O(NlogN) solution don't have a big difference.