NYOJ-rock (6)
Stone (6) Time Limit: 1000 MS | memory limit: 65535 KB difficulty: 3
-
Description
-
Recently, the PIAOYI and HRDV of TopCoder were boring, so I thought of a game. The game was like this: There were n piles of stones, and two people took turns to take some stones from one of them, the last one cannot be the loser. Note: You can only get any one from the heap at a time. You can get the heap, but you cannot cancel it. Let's assume PIAOYI gets the stones first and asks you to help him determine whether he can win (if they do not make mistakes during the process, they are smart enough ).
-
Input
-
Input n in the first line, which indicates there are n groups of test data (n <= 10000)
The test data in each of the following groups contains two rows: the first row contains an integer m, which indicates that the test data in this group has m (m <= 1000) Heap stones;
: Row 2: contains the m integer Ai (Ai <= 100), representing the number of I-heap stones, respectively.
-
Output
-
If PIAOYI wins and outputs "PIAOYI", otherwise, output "HRDV". Note that each group occupies one row ..
-
Sample Input
-
321 133 8 1125 10
-
Sample output
-
HRDVHRDVPIAOYI
Code:
#include
int main(){int T;scanf("%d",&T);while(T--){int n,i,k=0,t;scanf("%d",&n);for(i=0;i