Test instructionsThere are m stacks of poker on the table, and the number of cards per pile is ni (i=1 ... M);Two people take turns, each step can choose a bunch and take away any cards;The poker on the table is all taken out, then the game is over, and the last person to pick the card is the winner.ExercisesNimbo Game (Nimm game)First of all heap Nim-sum = N1 ^
Being a good boy in Spring FestivalTime limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)Total submission (s): 5157 Accepted Submission (s): 3092Problem description A year outside parents timeSpring Festival Home Can you do a few days good boy?Try to do the following things in winter vacationSpend time with mom on the vegetableQuietly buy a little gift for dadTake the initiative to
#include A typical NIM game.For all the number of different or, if 0, then the initiator is a must lose, the direct output of 0 end;If not 0, then the calculation has several scenarios, such as input things 5 7 8 9 10 (5 stacks of Poker)So what about (5 7 8 9 10)?1. Cannot be taken from 5, because 7^8^9^10=122. Cannot be taken from 7, because 5^8^9^10=103.1 (5,7,7,9,10) can be taken from 84.0 can be removed from 9 (5, 7, 8, 9, 10)5.3 (5,7,8,9,7) can be removed from 10Being a good
Being a good boy in Spring FestivalTime limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)Total submission (s): 4658 Accepted Submission (s): 2781Problem description A year outside parents timeSpring Festival Home Can you do a few days good boy?Try to do the following things in winter vacationSpend time with mom on the vegetableQuietly buy a little gift for dadTake the initiative to a
guess 0-60 of the number ' read-p ' Please enter your price: "Aexpr $A +1 >/dev/nullif[$?-ne0]then echo "Don't tease me, just guess the Numbers" ipplefi}guess () { if[ $A -eq $NUM ] then echo "guessed right, is $num yuan" exit0elif[ $A -gt $NUM NBSP;]NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;THENNBSP;NBsp;echo "Hey, why don't you buy it at this price?" "ipple elif[ $A -lt $NUM ] then echo "too low and too low" NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;IPPLENBSP;NBSP;NBSP;NBSP;NBSP;NBSP
Considering the process of proving the Bouton theorem, the Nim with n number and (XOR) is X, the highest bit of 1 in the K-bit, then the n number must have a Y in the K is also a 1.To change the number of Y to x xor y, then the number of N Nim and 0, will be converted to the initiator will be defeated situation.So how many kinds of the initiator, just see the number of N in how many y, to meet the binary K is a 1.1#include 2 3 Const intMaxh = -;4 Const intMAXN = -+Ten;5 intA[MAXN];6 7 intMain ()
Being a good boy in Spring Festival
Time limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): Wuyi Accepted Submission (s): 45
Problem Description a year outside parents timeSpring Festival Home Can you do a few days good boy?Try to do the following things in winter vacationSpend time with mom on the vegetabl
Being a good boy in Spring Festival
Time Limit: 1000MS
Memory Limit: 32768KB
64bit IO Format: %i64d %i64u
Submit StatusDescriptionA year away from parents are worried aboutSpring Festival Home Can you do a few days good boy?Try to do the following things in winter vacationSpend time with mom on the vegetableQuietly buy a little gift for dadTake the initiative
Being a good boy in Spring FestivalTime limit:MS Memory Limit:32768KB 64bit IO Format:%i64d %i64u SubmitStatusPracticeHDU 1850Appoint Description:System Crawler (2015-03-07)DescriptionA year away from parents are worried aboutSpring Festival Home Can you do a few days good boy?Try to do the following things in winter vacationSpend time with mom on the vegetableQuietly buy a little gift for dadTake the init
Title Link: http://acm.hdu.edu.cn/showproblem.php?pid=1850Problem description A year outside parents timeSpring Festival Home Can you do a few days good boy?Try to do the following things in winter vacationSpend time with mom on the vegetableQuietly buy a little gift for dadTake the initiative to ask for a bowl wash once and for allOne 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 litt
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
Being a good boy in Spring Festival
Time limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)Total submission (s): 5069 Accepted Submission (s): 3034
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 in
Title Address: HDU 1850This game theory is different or this place feels really around, think about it, and finally give it clear. Summarize what you didn't understand before:1: In the current operation, as long as you can achieve a certain must fail, then this point must be a winning state, because to win, will definitely choose the operation of the failure state.2: Only when all values of the XOR value of 0 is a must, so say for the N heap of Nim
Idea: If the total number of cards is different or the result of ans is 0, then must lose, output 0. Otherwise, you must give the other party a P-state, you can have all the poker heap to be checked, will ans^a[i] can be obtained in addition to a[i] Other poker number of different or results tmp, the purpose is to make TMP is 0, then certainly to take some cards from the a[i] heap, so that the remaining card number XOR or TMP is 0. What may happen (1) TMP is larger than a[i], then this is not th
When the point is p-position, the initiator losesWhen the point is n-position, i.e. A1^a2......^an = k;The first step of the initiator is to make a1^a2^.......^an^k = 0;So just ai^k #include #include #include using namespace Std;const int MAXN = 10000010;int NUM[MAXN];int main (){Freopen ("In.txt", "R", stdin);int n;while (scanf ("%d", n) n){int sum = 0;for (int i = 1;i {scanf ("%d", num[i]);Sum^=num[i];}if (sum = = 0){printf ("0\n");Continue;}int ans = 0;for (int i = 1;i {int t = num[i]^sum;if
Being a good boy in Spring FestivalTime limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)Total submission (s): 6682 Accepted Submission (s): 4039problem Descriptiona year away from parents are worried aboutSpring Festival Home Can you do a few days good boy?Try to do the following things in winter vacationSpend time with mom on the vegetableQuietly buy a little gift for dadTake the i
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): 2930Problem description A year outside parents timeSpring Festival Home Can you do a few days good boy?Try to do the following things in winter vacationSpend time with mom on the vegetableQuietly buy a little gift for dadTake the initiative to
Being a good boy in Spring Festivalproblem DescriptionA year away from parents are worried aboutSpring Festival Home Can you do a few days good boy?Try to do the following things in winter vacationSpend time with mom on the vegetableQuietly buy a little gift for dadTake the initiative to ask for a bowl wash once and for allOne day get up early and give mom and dad a heart for breakfast.You can talk to Mom a
Being a good boy in Spring FestivalTime limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)Total submission (s): 7841 Accepted Submission (s): 4811Problem description A year outside parents timeSpring Festival Home Can you do a few days good boy?Try to do the following things in winter vacationSpend time with mom on the vegetableQuietly buy a little gift for dadTake the initiative to a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.