Скоро Codeforces Round 1133 (Div. 1, Div. 2)! Регистрация здесь. ×

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

Автор SharvanCN1, история, 3 года назад, По-английски

This was my submission 256491105. Can somebody explain to me why this solution gives TLE?

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

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

You’re making an array of size $$$2e5+1$$$ for every test case and there are like $$$10^4$$$ tests. Instead you should’ve made the array of size $$$n+1$$$, and then proceeded with whatever you’re doing (this will get rid of the TLE)