I'm getting TLE on 1542B with O(logn) (i think)

Правка en1, от pedrovictor48, 2021-07-04 02:13:45

Firstly i came up with this solution: https://codeforces.net/contest/1542/submission/121218884 I think it's O(n) in worst cases, and i got TLE. But shouldn't O(n) be sufficient for these constraints?

After the contest I also updated a O(logn) solution, and its similar to others that i saw submitted, but its getting TLE too: https://codeforces.net/contest/1542/submission/121269280

What am I missing here?

Теги #help me, #beginner, #time complexity

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский pedrovictor48 2021-07-04 02:13:45 580 Initial revision (published)