for the contest on june 8 .. codeforces round 356 my c problem had initially been accepted and later had been failed towards the very end of the contest due to which it did not come to my notice .. just informing. my first solution 18322989 was denied afer the contest was over but was initially accepted. after the contest i submitted the write solution 18330104.. this was very depressing.









There is no confusion here. During contest, you missed 4 (look at your for loop, it doesn't count 18th index). While in your AC solution, the limit of for loop changed to
i<19thus counting 4 and getting it accepted.i know but i didn't know i made the error until after the contest was over because it got accepted
It was not "accepted". It just passed pretests and not all tests. After contest, it failed system tests which included the test case of 4.
During the contest, when you see "pretests passed", it means that your solution has passed a small subset of the test cases for which it was checked. They do not contain all types of test cases, unlike the main test cases, whose testing is done after the contest is over. Unfortunately, there was no test case in the pretests which covered the 18th index, because of which it got "pretests passed", but the main tests contained.
In short :
"Pretests passed" => Solution has passed a small subset of test cases.
"Accepted" => Solution has passed all test cases, and is judged correct.