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

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

I know this might be crazy but i tried to attempt a E question with a simple solution which might hit a TLE, but got a wrong answer in test case 4.Can anybody help me point out where i have gone wrong? I tried figuring out where i had gone wrong, but couldnt find out. Thank you.

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

»
8 лет назад, # |
Rev. 2   Проголосовать: нравится +6 Проголосовать: не нравится

Change

if(n>42)
return ispower(n / 42);

to

if(n>42 && n % 42 == 0)
      return ispower(n/42);

and it will get tle.