Rock game (M heap)
Time Limit: 3000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)
Problem descriptionm heap stone, two people take turns. it can only be retrieved from 1 heap. winner. the first accessor outputs No. the attacker wins the output of yes, and then how to obtain the child. for example, 5 heap 5, 7, 8, 9, and 10 won the winner first. When the first accessors take the first 1st times, they can take the remaining one from the eight heap, you can also take 9 out of 9 and the remaining 0 out of 10.
There are multiple input groups. 1st rows in each group are m, and m <= 200000. The next M is a non-zero positive integer. m = 0 and exits.
The output operator outputs No. the first accessors win the output yes, and then all the methods of the first accessors take the child 1st times. if you take several from the heap with a gravel and then the remaining B will win, then output a B. see sample output.
Sample Input
245 4533 6 955 7 8 9 100
Sample output
NoYes9 5Yes8 19 010 3
Nheim game !!!!
In the nheim game, all numbers are different or 0 is a singular trend !!!
The AC code is as follows:
#include<stdio.h>int a[200005];int main(){ int n; int sum; int i; while(~scanf("%d",&n)&&n) { sum=0; for(i=0;i<n;i++) { scanf("%d",&a[i]); sum=sum^a[i]; } if(sum==0) printf("No\n"); else { printf("Yes\n"); for(i=0;i<n;i++) { if(a[i]>=(sum^a[i])) printf("%d %d\n",a[i],sum^a[i]); } } } return 0;}