Doubt regarding time limit?

After making submission some time is displayed as shown in the image below. I want to confirm whether this time is time taken by my program for all the test cases or maximum time taken by any test case.

Another question which I have is that, for this question the time limit given was 2 sec and my solution took more then that still it got accepted. Anyone please clear this confusion, I have had this time many time.

The submission time shown is the max time taken by a single testfile among all testfiles. The Time limits are mentioned with reference to c c++ solutions and time limit is generally 2 * originalTimeLimit for java and 3*originalTimeLimit for Python(earlier it was 5 recently reduced to 3 by codechef). Since you are using java the time limit would be 4 sec instead of 2 because java is inherently slower than C,C++.


Thank you so much.