spoj#PSYCHOT. Psycho34 (easy)
Psycho34 (easy)
In the prime factorization of a number N, there's two kinds of powers.
Even powers, in red, are psychotic ones, and odd powers, in blue, are ordinary ones.
We'll say N a Psycho number if the count of even powers is
strictly greater than the count of odd powers, else an Ordinary number.
For example, if N = 67500 with prime factorization
67500 =
22
x
33
x
54
.
This number have 2
even powers
and 1
odd power.
Since 2>1, so the number 67500 is a Psycho Number.
Input
The first line of input contains an integer T, the number of test cases.
Each of the next T lines contains one integer N.
Output
For each test case, print if N is Psycho or Ordinary number.
Example
Input: 2 3 4Output: Ordinary Number Psycho Number
Constraints
0 < T < 10^4 1 < N < 10^14
Time limit is ×2 my top speed with Python3 language, it could be not easy with slow languages.
O(N^.5 / log(N)) should give TLE even with fast languages. You are awaited to submit something between O(N^0.33 / log(N)) and O(N^0.25 / log(N)).
You can try before the quite similar "tutorial" problem : Psycho before.
@speed addicts : my top C timing is 0.02s. (TL updated 2017-02-11 ; compiler changes)