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

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

Make a Power of Two In this problem, I wrote the code and it gives me TLE on test case-3 without any reason because my code runs in worst-case (269*11) = 2959 and the time limit for this problem is "one second" but still it gives me TLE why? I don't have any Idea anyone help me

My code
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

make_power_of_2() should be preprocessed. You're calling it per testcase without clearing it (looking at Your submission). 40 push_backs per case making its size 40 * 10 ^ 4.

Call it once, or clear the vs vector after each testcase.

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

use 2**62 or larger