PSYCHON - Psycho
Given an integer N, the number N is called “Psycho Number”. Psycho Number is calculated as follows:
First, If we factorize N , then we have some prime and their power. Assume that, there are M powers. From M powers , you should count the number of even and odd powers. Then if the number of even power is strictly greater than odd power, then we call the number N is “Psycho Number”, otherwise the number N is call “Ordinary Number”.
As for example, if N = 67500 then prime factorization,
67500 = 22 x 33 x 54.
Count even powers and odd powers . This number have 2 even power(2, 4) and 1 odd power (3). Since even power 2 (2, 4) is greater than odd power 1 (3), so the number 67500 is a Psycho Number.
Input:
An integer T (1 <= T <= 106) denoting the number of test cases followed by T lines. Each containing a single integer N (1 <= N <= 107).
Output:
For each case print “Psycho Number” or “Ordinary Number”.
Sample
Sample Input 2 3 4 Sample Output Ordinary Number Psycho Number
Note: 0 and 1 are not a psycho number.
Psycho 2: Psycho Function Psycho 3: Make Psycho Psycho 4: Psycho34 (easy)
Problem setter: Shipu Ahamed, Dept. of CSE, Bangladesh University of Business and Technology (BUBT)
[ Edited by EB ] Warning: Some input files are broken.
hide comments
Abhinav:
2015-05-20 14:25:51
Finally after 7 WA and 5 Tle ...... AC :) |
|
Madhav:
2015-04-02 14:18:25
good question!! |
|
Sayak Haldar:
2015-03-04 20:46:56
nice one..:) Last edit: 2015-03-10 05:17:51 |
|
Kid Algorist:
2015-01-04 23:53:01
I wonder why fast I/O gives a TLE and scanf/printf ACs in 0.32.
|
|
xiaowuc1:
2014-12-26 23:47:02
The input data do not conform to the given specification. See submission ID 13276252, which attempts to read in T lines and throws an error if it encounters a NULL string. |
|
[Lakshman]:
2014-05-23 09:21:20
Read this in problem statement "even power is strictly greater than odd power" Last edit: 2014-05-23 09:36:18 |
|
[Lakshman]:
2014-05-23 07:58:31
@codenite what is your output for this 1875248? for help you can come to forum.
|
|
Andy:
2014-05-14 19:36:55
just inputting and outputting random answer get tle, then how do I solve this?
|
|
[Lakshman]:
2014-05-14 13:00:51
@Francky what about new Psycho with n<=10^18.
|
|
Francky:
2014-05-14 13:00:51
Basic brute force can pass. Problem (and others) moved to tutorial.
|
Added by: | Shipu Ahamed |
Date: | 2013-09-18 |
Time limit: | 0.5s |
Source limit: | 6000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |