ZOJ2725_Digital Deletions】的更多相关文章

题意是这样的,一开始给你一串数字,两个人轮流操作,操作可以分为两种. 1.每次修改一个数字,使其变为一个小于当前的非负数. 2.移除中间的某一个0以及0右边的所有数字. 使得所有数字消失的游戏者获胜. 题目有一个很关键的条件,最多只有6为,其实我们可以这样考虑这个问题. 对于每一位,最多有11种状态,0到9以及空. 所以我们可以用6个11进制表示所有的状态,这样算来时间上是可以承受的. 然后的话,就是典型的记忆化搜了,对于每一个数,枚举每一种后继的状态,然后用基本的博弈知识判断该状态是必胜还是必…
Digital deletions is a two-player game. The rule of the game is as following. Begin by writing down a string of digits (numbers) that's as long or as short as you like. The digits can be 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and appear in any combinations tha…
B. Parity Alternated Deletions Polycarp has an array aa consisting of nn integers. He wants to play a game with this array. The game consists of several moves. On the first move he chooses any element and deletes it (after the first move the array co…
暴力打表!! 代码如下: #include<iostream> #include<algorithm> #include<cstdio> #include<cmath> #include<cstring> #define M 1000000 #define ll __int64 using namespace std; ]; int get_len(int n) { ) ; ) ; ) ; ) ; ) ; ; } void solve(int n…
首先如果第一个数字是0的话,那么先手必胜. 对于一个已知的先手必败状态,凡是能转移到先手必败的状态一定是必胜状态. 比如1是必败状态,那么2~9可以转移到1,所以是必胜状态. 10,10*,10**,10***,10****也都可以删除1后面那个0,转移到1,所以也是必胜状态. #include <cstdio> #include <cstring> #include <cstdlib> ; ]; void init() { ], s1[]; , j; i <=…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1404 一看就是博弈论的题目,但并没有什么思路,看了题解,才明白 就是求六位数的SG函数,暴力一遍,打表就OK. 具体的操作是先找P态,即最终无法移动的状态,可知无数可取是P态,0是N态,1是P态,然后从1开始进行暴力, 所有可以到!sg[i]的点标记为N态,暴力过程为标记一步可以到sg[i]的数,包括两类: 一类是仅某一位数字不同,提取方法比较巧妙: ; --i){ int m = x; ; ; j…
4  lib/matplotlib/__init__.py View   @@ -126,9 +126,9 @@ def compare_versions(a, b):     else:     return False           -if not compare_versions(six.__version__, '1.5'):     +if not compare_versions(six.__version__, '1.3'):     raise ImportErr…
Problem地址:http://acm.hdu.edu.cn/showproblem.php?pid=1404 刚开始想采取找规律的方法解题,可以没有发现规律.无奈,只好采用求PN点的方法. 我们假设数字最右边为第一位,且为最低位.那么可以知道当最高位为0时,那么先手的人必定能胜利,这个可以作为一个剪枝条件. 接下来就是两种操作了:1.降低其中任何一位   2.把其中一个0及这位0后面所有的数字删去 我们只需通过这两个操作,寻找目标数字的后续数字状态的PN状态,即可求得目标数字的PN状态.其实…
题意:给定一个数字串,最长是6,然后有两种操作. 第一种是,把该串中的一个数字换成一个比该数字小的数,比如 5 可以换成 0,1,2,3,4.   e.g. 12345 --> 12341 第二种是,把数字 0 以及它后面的数都删掉,e.g.  120154 --> 12 析:因为数字最长是 6 位,所以直接把所有的情况都算出来,就好了,这首先 g[1] = 0,然后能够该必败态的,都是必胜态,然后没有到达的点都是必败点,就这样就可以筛选了,还要注意的事从必败态去筛选必胜态的时候,有两种情况,…
When developing an XAF application, you may be required to rename a persistent class or property due to refactoring specifics or changed business requirements. An XAF application launched in debug mode automatically creates required tables and column…