TIPTOP - Tip Top Game
Alim and sufian are two good friends. They loves to playing game with number recently they discover a new game name “Tip Top”. The rule of the game is they took a number (N) randomly after that they find the all divisors of N. Then they starting to play the game first alim took a divisor, then sufian so on. The person who took the last divisor will win the game.
Every time the game started with alim . Now alim wants to know when he will win.
As you a good programmer your task is to find will alim win or not.
Input starts with an integer T ( T ≤ 105 ), denoting the number of test cases. Each case starts with a line containing an integer N ( 1 ≤ N ≤ 1018 ) the number.
For each case you have to print “Yes” if alim will win otherwise “No” with case number. See the sample input/output for exact formatting.
Case 1: Yes
Case 2: No
Problem setter: Ajharul Islam Barid, Dept. of CSE
Bangladesh University of Business and Technology (BUBT)
No need to calculate all the divisor!!
[EDITED with answers]
take :-> unsigned long long s=sqrt(n);
long long,space,\n costed me 3 WA -_-
WA in 4.3.2 and AC in 14. why so?
if(sqrt(n)==floor(sqrt(n))) gives wrong ans.
Use sqrtl() for large integers square root.
same as sinha and eggs.......
Interesting problem to tackle. Would have been a very frustrating, non-learning experience if I didn't turn to comments.
unsigned long long ..