ExpectoPatronum's blog

By ExpectoPatronum, history, 4 years ago, In English

105860386 If I'm not mistaken the complexity of this code is O(n) with 1 <= n <= 10^9 . Please explain to me !!. Thank you.

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

»
4 years ago, # |
  Vote: I like it +4 Vote: I do not like it
»
4 years ago, # |
  Vote: I like it +24 Vote: I do not like it

Amazing compiler~~~

»
4 years ago, # |
  Vote: I like it +12 Vote: I do not like it

Check this — 106281265

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    "tle" doesn't effect the answer, so the compiler ignored it.

    Maybe he added it on purpose to make others hack it. My friend has been tricked. Ha ha!

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Check this: https://codeforces.net/contest/1398/submission/90016644

O(n^2) solution passed in 1.6sec for 1<=n<=10^5.