COMDIV - Number of common divisors
You will be given T (T<=10^6) pair of numbers. All you have to tell is the number of common divisors between two numbers in each pair.
First line of input: T (Number of test cases)
In next T lines, each have one pair A B (0 < A, B <= 10^6)
One integer describing number of common divisors between two numbers.
WTH How can using cout instead of printf cost a WALast edit: 2019-03-18 17:47:35
I don't what to do anymore --- should I use cin, cout or scanf ,printf
this was wayy more easy than i thought,
Just use scanf and printf for I/O , avoid cin & cout in C++ costed me TLE.
What's the application of gcd in this problem??
AC in 3rd go , just use fast input/output , no need to build sieve , just find factors for every test case in O(sqrt(n))Last edit: 2018-10-14 17:51:15
use Fast I/O using better mathematical logic , no need to use scanf printf..
use scanf and printf , no need to use seive
bhosadi waalo ac in one go ka kya show off krte rehte ho gand utha ke har jagah