Jynx's blog

By Jynx, history, 6 years ago, In English

I am trying to solve this problem
https://www.codechef.com/problems/COPRIME3 ( on codechef )

using the method specified here https://discuss.codechef.com/questions/77146/amr15b-editorial .

(Basically finding count of all triplets of numbers which have GCD > 1 )

But For some reason I am getting TLE .

https://ideone.com/zmxQ9u (My Submission )

Am I doing something wrong ? Please Help .

Full text and comments »

  • Vote: I like it
  • -5
  • Vote: I do not like it

By Jynx, history, 6 years ago, In English

http://acm.timus.ru/problem.aspx?space=1&num=1208

I got AC on this problem with a naive k*(2^k) solution .

Is there any other way to solve it using graph theory ?

Full text and comments »

  • Vote: I like it
  • -11
  • Vote: I do not like it