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

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

this is my solution http://ideone.com/5i1hV2 for the problem

https://www.codechef.com/LTIME16/problems/CHEFB

in this problem i am getting TLE whn n<=100000 and array size<=1000000

but when i removed memset and wrote that step normally by bruteforce ....i got AC........

what happened with that memset();

why?????????????????

this is my modified solution

http://ideone.com/G6t0fX

thanks in advance

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

»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

This is can be solved by applying sieve and count the different prime factors for your numbers.