Ezio07's blog

By Ezio07, history, 6 years ago, In English

Following are my two C++ submissions for today`s contest AIM Tech Round 5 problem C,

Time Limit Exceeded

Accepted

Both are exactly same except an extra semicolon.

The solution is of O(NlogN) time complexity. Although my submissions were after the contest, but its highly likely that some users may have faced the similar issue during the contest, which is unfortunate.

  • Vote: I like it
  • +17
  • Vote: I do not like it

»
6 years ago, # |
  Vote: I like it +11 Vote: I do not like it

I guess it is because servers fluctuation. There is a same problem.

Also, try to use ios_base::sync_with_stdio(false);cin.tie(0); next time.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yeah thanks! It works pretty fast that way. But maybe time limits or constraints for such problems should be adjusted so that either most of O(NLogN) pass or most of them fail.

    For example, time limit was 3 seconds for a very similar problem (with similar constraints) Maximal Intersection of round 506, which allows most O(NLogN) solutions to pass.