hdu 1564 Play a game (博弈)
Play a game
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1182 Accepted Submission(s): 969
ailyanlu is very happy today! and he is playing a chessboard game with 8600.
The size of the chessboard is n*n. A stone is placed in a corner square. They play alternatively with 8600 having the first move. Each time, player is allowed to move the stone to an unvisited neighbor square horizontally or vertically. The one who can't make a move will lose the game. If both play perfectly, who will win the game?
The integers are between 1 and 10000, inclusive,(means 1 <= n <= 10000) indicating the size of the chessboard. The end of the input is indicated by a zero.
No other characters should be inserted in the output.
0
- //0MS 228K 195 B G++
- /*
- 题意:
- 有一块石头在某个角,两个人轮着推,无法推时输
- 博弈:
- 水题
- */
- #include<stdio.h>
- #include<string.h>
- int main(void)
- {
- int n;
- while(scanf("%d",&n),n)
- {
- if(n%) puts("ailyanlu");
- else puts("");
- }
- return ;
- }
hdu 1564 Play a game (博弈)的更多相关文章
- HDU 1564 简单博弈 水
n*n棋盘,初始左上角有一个石头,每次放只能在相邻的四个位置之一,不能操作者输. 如果以初始石头编号为1作为后手,那么对于每次先手胜的情况其最后一步的四周的编号必定是奇数,且此时编号为偶数,而对于一个 ...
- HDU 1524 树上无环博弈 暴力SG
一个拓扑结构的图,给定n个棋的位置,每次可以沿边走,不能操作者输. 已经给出了拓扑图了,对于每个棋子找一遍SG最后SG和就行了. /** @Date : 2017-10-13 20:08:45 * @ ...
- 取石子游戏 HDU 1527 博弈论 威佐夫博弈
取石子游戏 HDU 1527 博弈论 威佐夫博弈 题意 有两堆石子,数量任意,可以不同.游戏开始由两个人轮流取石子.游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子:二是可以在两 ...
- HDU 1564 Play a game && HDU 2147 kiki's game
HDU 1564 Play a game题意: 棋盘的大小是n*n.一块石头被放在一个角落的广场上.他们交替进行,8600人先走.每次,玩家可以将石头水平或垂直移动到一个未访问的邻居广场.谁不采取行动 ...
- HDU 1564 找规律博弈
题目大意是: 从n*n的方格角落的一个起点出发,每次移到上下左右一个未曾到达过的位置,谁不能走了谁就输了 想了好久都想不出,看了大神的题解 Orz了 果然博弈不是脑残的游戏啊... 这里从起点出发,将 ...
- 题解报告:hdu 1564 Play a game(找规律博弈)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1564 Problem Description New Year is Coming! ailyanlu ...
- HDU 1564 Play a game(巴什博弈)
New Year is Coming! ailyanlu is very happy today! and he is playing a chessboard game with 8600. The ...
- HDU 1564 (博弈) Play a game
这道题的答案猜也很好猜出来,但是想太难想了..题解一贴,然后闪人.. 请戳这
- HDU 1564 Play a game (找规律博弈)
Play a game Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
随机推荐
- 在线代码编辑器 Codemirror 的轻量级 React 组件
代码编辑器 CodeMirror 的轻量级 React 组件 demo @uiw-react.github.io/react-codemirror/ 特性:
- Win10上Anaconda环境下python3.6安装和使用pyinstaller
一.安装步骤 1. 电脑是win10,安装的Python3.6 2. 在Scripts文件夹下执行pip install pyinstaller, 安装成功后下载pyinstaller安装包,解压之后 ...
- go get超时解决办法
go get gopkg.in/yaml.v2超时,发现被墙了,解决办法如下: 1.安装golang.org/x/net $ mkdir -p $GOPATH/src/golang.org/x/ $ ...
- Javascript简单特效及摘要
1.js中的Element对象 ** var input1=docuemnt.getElementById("input1"); //alert(input1.value); // ...
- POJ:2385-Apple Catching(dp经典题)
Apple Catching Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14311 Accepted: 7000 Descr ...
- HDFS写数据和读数据流程
HDFS数据存储 HDFS client上传数据到HDFS时,首先,在本地缓存数据,当数据达到一个block大小时.请求NameNode分配一个block. NameNode会把block所在的Dat ...
- Github上最受关注的前端大牛 快来膜拜把!
Github上最受关注的前端大牛 快来膜拜吧! 来源:csdn 发布时间:2014-08-06 阅读次数:4058 14 本文列出了Github上最受关注的10位前端大牛.看看他们负责的项目和提交 ...
- Grub Rescue修复方法[repost]
From : http://www.2cto.com/os/201111/112327.html 症状:开机显示:GRUB loading error:unknow filesystem grub r ...
- shell脚本从文件夹中递归提取文件
需求 前两天碰到需要在十层左右的文件夹中提取文件的需求,于是写了此脚本. 如下面这样的文件结构: dir1 ├── a │ ├── b │ │ └── file1 │ └── file2 ├── c ...
- ajax向Asp.NET后端传递数组型数据
近日,在开发一个组件的过程中,需要通过Ajax对象向Asp.NET后端传递一个比较复杂的表单,表单中的一个字段是数组类型,我能想到的办法是用JSON.stringify将前端的数组对象序列化成字符串, ...