Being a good boy in Spring FestivalTime
limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): 4894 Accepted Submission (s): 2930
Problem description A year outside parents time
Spring Festival Home Can you do a few days good boy?
Try to do the following things in winter vacation
Spend time with mom on the vegetable
Quietly buy a little gift for dad
Take the initiative to ask for a bowl wash once and for all
One day get up early and give mom and dad a heart for breakfast.
You can talk to Mom and dad if you want.
Let's play a little game. ACM Class to School ~
Here is a two-person mini-game: There are m stacks of poker on the table, and the number of cards per pile is ni (i=1 ... M); The two take turns, and each step can be arbitrarily selected and taken away from any of the cards; the poker on the table is all out, then the game is over; the last person to pick the card is the winner.
Now we do not want to study whether to win or negative, I just want to ask you:
-"If the initiator wants to win, the first step has several options?" ”
The input data contains multiple test cases, each with 2 rows, and the first line contains an integer m (1<m<=100), which represents the number of stacks of poker, followed by a line containing M-integers Ni (1<=ni<=1000000,i=1 ... m), representing the number of M-Heap poker, respectively. An M of 0 indicates the end of the input data.
Output if the initiator can win, please export his first feasible number of scenarios, otherwise please output 0, the output of each instance takes up one row.
Sample Input
35 7 90
Sample Output
1
Authorlcy
SOURCEACM Short Term exam_2007/12/13//Another problem in Nim's game
#include <stdio.h>int main () {int i,n,sum,ans,a[102];while (scanf ("%d", &n) &&n) {for (i=0,sum=0;i <n;i++) {scanf ("%d", &a[i]); sum^=a[i];} for (i=0,ans=0;i<n;i++) {if ((Sum^a[i]) <a[i])
Being a good boy in Spring Festival (Hang Power 1850) (Nim game)