Rektyu's blog

By Rektyu, history, 7 months ago, In English

This is concerning the problem 1852A - Ntarsis' Set:

In contest I TLE'd on a system test with this submission: 215215642

Later, I changed only line 77 from int to long long, and this passes the time constraint comfortably: 215267529

Any ideas what's going on? Thanks in advance

  • Vote: I like it
  • -2
  • Vote: I do not like it

»
7 months ago, # |
  Vote: I like it +21 Vote: I do not like it

Hint : What is the output of

int x = 2e9
long long res = (x + x + 1)/2
cout << res << endl