Блог пользователя macaquedev

Автор macaquedev, история, 5 часов назад, По-английски

See this... How the hell does creating a 1e5 ish sized array 1e4 times pass?? I think he's probably hacked Codeforces or something...

  • Проголосовать: нравится
  • -42
  • Проголосовать: не нравится

»
5 часов назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

I think its fine. That is within the allowed number of iterations if you consider total tests.

  • »
    »
    5 часов назад, # ^ |
      Проголосовать: нравится -10 Проголосовать: не нравится

    1e9 should not pass in 2 seconds

    • »
      »
      »
      4 часа назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

      Maximum number of iterations is ~63245 because $$$(N+1)*N/2<MAX$$$ .

      So in total it will be $$$6*(1e8)$$$ which is fine.

    • »
      »
      »
      4 часа назад, # ^ |
        Проголосовать: нравится +5 Проголосовать: не нравится

      Even if was a pure 1e9, it still depends on other constants. There are huge differences between performing 1e9 additions and 1e9 prints, and the former even fits in like 0.5s, whilte the latter can't run even in 10s. Pushing to a vector is a little more heavier, but 6e8 still barely fits in 2s.

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

it's not 1e9 iterations as it's increasing each time like this 1 3 6 10 15 21 27 so it's not 1e9 so it passed

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

For every test case a new array of at max 1e4 will be created. Which is anyways fine. What is the problem here?

»
3 часа назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Eliminated.

  • »
    »
    3 часа назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    How did you do it? Can you tell me what testcase you used? I did the maximal one (1 1000000000, repeated 10000 times) and that did not TLE...