Number of common divisors

Revision en1, by Kn0wthyself, 2024-02-29 05:12:25

Today I am share my new experience . I am trying to solve a problem in SPOJ. Problem link:https://www.spoj.com/problems/COMDIV/ When I solve this problem using C++ it gives TLE for simple code. For this problem my solving approach was at first find the GCD of two values than from 1 to GCD I use a loop if any number is divided by that than i count it for two time without corner case. But it gives me Time Limited Exceed. I really become astonished to see this. Than just i convert it into c . instead of cin use scanf and instead of cout use printf than it accept the code. Truly it was a bad experience for me in problem solving.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Kn0wthyself 2024-02-29 05:12:25 663 Initial revision (published)