Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7410 Accepted Submission(s): 3127 Problem Description Arthur and his sister Caroll have been playing a game called Nim for some time now. Nim is pla…
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2016 Accepted Submission(s): 1048 Problem Description Nim is a two-player mathematic game of strategy in which players take turns removing objects f…
S-Nim Problem Description Arthur and his sister Caroll have been playing a game called Nim for some time now. Nim is played as follows: The starting position has a number of heaps, all containing some, not necessarily equal, number of beads. The pl…
S-Nim Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7262 Accepted Submission(s): 3074 Problem Description Arthur and his sister Caroll have been playing a game called Nim for some time now.…
S-Nim Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3077 Accepted Submission(s): 1361 Problem Description Arthur and his sister Caroll have been playing a game called Nim for some time now…
题意:针对Nim博弈,给定上一个集合,然后下面有 m 个询问,每个询问有 x 堆石子 ,问你每次只能从某一个堆中取出 y 个石子,并且这个 y 必须属于给定的集合,问你先手胜还是负. 析:一个很简单的博弈,对于每组数据,要先处理出SG函数, 然后使用组合游戏和来解决就ok了,对于求sg函数,很明显,就是求所有的mex,也就是未出现过的最小自然数.最后取异或就ok了. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000"…
S-Nim Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4770 Accepted Submission(s): 2058 Problem Description Arthur and his sister Caroll have been playing a game called Nim for some time now.…
S-Nim Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7751 Accepted Submission(s): 3266 Problem Description Arthur and his sister Caroll have been playing a game called Nim for some time now.…
S-Nim Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5637 Accepted Submission(s): 2414 Problem Description Arthur and his sister Caroll have been playing a game called Nim for some time now.…
John Problem Description Little John is playing very funny game with his younger brother. There is one big box filled with M&Ms of different colors. At first John has to eat several M&Ms of the same color. Then his opponent has to make a turn. A…
题意:给你很n堆石头,k代表你有k种拿法,然后给出没堆石头的数量,求胜负 直接套用模版 找了好久之前写的代码贴上来 #include<iostream> #include<algorithm> #include<cstring> using namespace std; int s[101],sg[100001],k; int mex(int m) { int vis[101]={0}; int i; for(i=0;i<k;i++) { int v=m-s[i]…
Nim or not Nim? Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 3032 Description Nim is a two-player mathematic game of strategy in which players take turns removing objects from distinct heaps.…