Why am I getting a TLE in this code?

Правка ru1, от fan_balae, 2020-05-23 13:26:50

Link to submission: https://codeforces.net/contest/1324/submission/81004543

The algorithm is similar to what most others used but this is showing a TLE on the 24th test. Can anyone point out my error?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
ru1 Русский fan_balae 2020-05-23 13:26:50 239 First edition (опубликовано)