Someone please tell me why my code doesnt show TLE for this bit masking question?


#1

Question Link
https://www.codechef.com/problems/MARCHA1

Here the complexity of the bit masking code we would write would be O(n2^n) and this will be done t time. So O(tn*2^n).

Also, I’ve read somewhere that 2^20 operations take about 1 seconds. As our limit for n is 20 and t is 100, it should take approx 100 seconds right??

Why does my code take less than even 1 sec ?? My Solution Link : https://www.codechef.com/viewsolution/24481816

Thanks a lot for taking out the time to read everything and to help me!!


#2

You can perform at most 10^8 iterations in about a second. This also depends on the processor so usually 10^6 is considered the safer side.


#3

Understood. Thanks a lot brother.