Getting TLE

Revision en1, by Evan_Shareef, 2020-09-08 10:27:00

Idea at a glance: I precalculated all the sum of phi() values till some range. Then while for some query I ran a binary search on the precalculated sum of the euler values.... So according to this process complexity should be O(n) + T*(log(n)

Problem:

https://algo.codemarshal.org/contests/icpc-dhaka-19-preli/problems/G

My code:

https://pastebin.com/XcvSPtse

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Evan_Shareef 2020-09-08 10:29:40 219
en1 English Evan_Shareef 2020-09-08 10:27:00 390 Initial revision (published)