Getting TLE because of using bitset

Revision en1, by Fahmid_rng, 2026-06-08 09:42:50

In last Div-2 contest, my this code 377729532 got accepted where this submission 377724457 recieved TLE verdict. Logic of both code are exactly the same. But, in the TLE version, I used bitset and used string instead in the AC submission. But, note that I initialized bitset array in global scope. So, in the TLE version, my code should do at max $$$3N + 2\sum n + T(8 \cdot \frac{N}{w} + 9 \cdot 31)$$$ operations. Here, $$$T \le 10^4, N = 10^5 + 1, w$$$ is word size i.e $$$64$$$. So, it shouldn't take more than $$$1.3$$$ s at all. But, then, why am I getting TLE? Can anyone explain, please?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Fahmid_rng 2026-06-08 09:49:46 2 Tiny change: 'sum n + T(8 \cdot \fr' -> 'sum n + T(7 \cdot \fr'
en1 English Fahmid_rng 2026-06-08 09:42:50 640 Initial revision (published)