sguu's blog

By sguu, history, 6 years ago, In English

Someone Plzz Tell me reason of TLE of above submission??

https://codeforces.net/contest/1017/submission/48585414

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

| Write comment?
»
6 years ago, # |
Rev. 3   Vote: I like it +3 Vote: I do not like it

O(224) = TLE

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

    it's around 2*10^7 operation.how could it give TLE?

    • »
      »
      »
      6 years ago, # ^ |
      Rev. 4   Vote: I like it 0 Vote: I do not like it
      1. it is around 2 * 108 operations
      2. it is O(22n * n) = O(109)
»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

it is O(2^24 * 12), but you can precalc fn(mask) for all masks

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

You should add the following 2 lines:

ios_base::sync_with_stdio(0);
cin.tie(0);

48588707