sazid's blog

By sazid, 12 years ago, In English

In Codeforces Round #175 (Div. 2) for Problem C a submission (3373203) got accepted. But the solution should get a TLE! I don't understand how this submission got accepted? I tried to run the code in the custom test section for an input,

20000
-1000000000
-1000000000
...
...
...
-1000000000

For this test case it should give TLE but it didn't. But in my computer it takes so much time that it can't be accepted. But why?

In this test case I give n = 20000, but in the problem it was even higher. It said, "The first line contains integer n (1 ≤ n ≤ 3X10^5) — the size of the sought permutation. The second line contains n integers a1, a2, ..., an ( - 10^9 ≤ ai ≤ 10^9)."

Same code gives TLE for same input in MS Visual C++ 2010 compiler but not in GNU C++ 4.7 !

Can anybody please explain it to me?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it