spoj 7718. Number of common divisors | COMDIV

the problem statement is simple, given two numbers just print the number of common divisors. One important fact useful to solve this problem is that divisors of gcd of two number are also divisors of the two numbers.

Python solution is giving TLE, even if it is 6 sec of time limit, whereas my C solution took 1.89s

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s