wretched's blog

By wretched, history, 12 months ago, In English

I have to count the sum where sum is LCM(1,N)+LCM(2,N)....+LCM(N,N). There also will be test case, T<=50000 and N<=1000000.Now I want to generate the sum for each number.How can I solve this,help me.

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
12 months ago, # |
  Vote: I like it 0 Vote: I do not like it

do precalculation before running the test case

  • »
    »
    12 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Obviously precalculation is required for this constrain.But I want to get idea about the precalculation :(

»
12 months ago, # |
  Vote: I like it 0 Vote: I do not like it