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

Автор vsanjay_nitdgp, история, 11 лет назад, По-английски

sir/mam, i solved this problem

https://www.codechef.com/problems/DIRTBYTE

this is my solution,,, http://ideone.com/dt6lxi

but i dont know why am i getting TLE.

couls anyone pls help me to get AC..

thank you.

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

»
11 лет назад, скрыть # |
Rev. 6  
Проголосовать: нравится 0 Проголосовать: не нравится

Your time complexity is O(20 * 220 * gcdtime), that one definitely doesn't fit into 1 sec. Just optimize it to O(gcdtime * 220). dp[mask] — lcm of all numbers in mask. , where bit is some one bit in mask.