//next_permutation全排列 # include <stdio.h> # include <algorithm> # include <string.h> using namespace std; struct node { int w; int v; }; struct node a ...
分类:
其他好文 时间:
2017-05-09 12:39:26
阅读次数:
204
Game of Taking Stones Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 456 Accepted Submission(s): ...
分类:
其他好文 时间:
2017-05-02 10:00:50
阅读次数:
155
ZOJ3964 解题思路 此题的题意比较容易理解,可以简单的看着 Nim 博弈的变种。但问题在于 Alice 对第 i 堆石子的取法必须根据 bi 确定。所以如果这个问题能够归结到正常的 Nim 博弈(取石子问题),则很容易解决。 考虑特判存在 bi=1 或 bi=2 的情况: 如果存在第 i 堆石 ...
分类:
其他好文 时间:
2017-05-01 12:49:44
阅读次数:
192
Alice and Bob are playing a stone game. Initially there are n piles of stones and each pile contains some stone. Alice stars the game and they alterna ...
分类:
其他好文 时间:
2017-04-26 22:56:20
阅读次数:
170
Two Nikifors play a funny game. There is a heap of N stones in front of them. Both Nikifors in turns take some stones from the heap. One may take any ...
分类:
其他好文 时间:
2017-04-26 13:06:46
阅读次数:
168
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 ston ...
分类:
编程语言 时间:
2017-03-24 23:07:52
阅读次数:
210
Nim Game 题目描述: You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to rem ...
分类:
其他好文 时间:
2017-03-11 13:02:19
阅读次数:
181
打表找规律即可。 1,1,2,2,2,3,3,3,3,4,4,4,4,4... 注意打表的时候,sg值不只与剩下的石子数有关,也和之前取走的方案有关。 ...
分类:
其他好文 时间:
2017-02-21 13:42:05
阅读次数:
235
考虑二分答案,转化为求有多少$\leq lim$的数满足条件。 从两侧往中间进行数位DP,设$f[l][r][j][x][y][z][pre][suf]$表示当前准备填的两个位置是$l$和$r$,已经有$j$对相邻的数不同,$l-1$填的是$x$,$r+1$填的是$y$,正序串和逆序串的大小关系为$ ...
分类:
其他好文 时间:
2017-02-02 21:56:43
阅读次数:
277
题目 You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 s ...
分类:
其他好文 时间:
2017-02-01 00:48:48
阅读次数:
207