In reply to zhuzeyuan's email:
The time used by the standard program is about 25s. The model solution is quite well optimised, but still requires O(n^2) time. However, it seems to be possible to solve the problem in a much faster way using a more optimal algorithm. Therefore solutions not faster than the model solution should really be treated with suspicion
.
If the problem "survives" until the next problemset without a single correct solution, the test data will be slightly modified and the time limit will be increased. But I wouldn't really count on this happening
.