题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1729 看了题目感觉像Nim,但是有范围限制,有点不知道SG函数该怎么写 看了题解,最后才明白该怎么去理解 . 首先进行对s和c进行分类, 1.c = 0 的时候,无论怎样都填不满,直接跳过: 2.c = s 的时候,先手必败,即是P态: 3.c < s 的时候,可以分为两种情况: 1)c^2 + c < s 的时候,递归 2)c^2 + c > s 的时候,先手必胜,即N态 int mex(…
F - Again Stone Game Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submit Status Description Alice and Bob are playing a stone game. Initially there are n piles of stones and each pile contains some stone. Alice stars the…
UVA 11927 - Games Are Important option=com_onlinejudge&Itemid=8&page=show_problem&category=478&problem=3078&mosmsg=Submission+received+with+ID+13891171" target="_blank" style="">题目链接 题意:给定一个有向图,结点上有一些石头,两人轮流…
S-Nim Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u Submit Status 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 numb…
Fibonacci again and again Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8198 Accepted Submission(s): 3412 Problem Description 任何一个大学生对菲波那契数列(Fibonacci numbers)应该都不会陌生,它是这样定义的:F(1)=1;F(2)=2;…