hdu4642 Fliping game ——博弈
link:http://acm.hdu.edu.cn/showproblem.php?pid=4642
refer to:
http://www.cnblogs.com/jackge/archive/2013/08/01/3231573.html
这道题目很有意思。
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <algorithm>
#include <queue>
#include <deque>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <functional>
#include <fstream>
#include <iomanip>
#include <sstream>
#include <numeric>
#include <cassert>
#include <ctime>
#include <iterator>
const int INF = 0x3f3f3f3f;
const int dir[][] = {{-,},{,},{,-},{,},{-,-},{-,},{,-},{,}};
using namespace std;
int main(void)
{
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
#endif
int t, n, m, tmp;
ios::sync_with_stdio(false);
cin>>t;
for (int i = ; i < t; ++i)
{
cin>>n>>m;
for (int j = ; j < n; ++j)
for (int k = ; k < m; ++k)
cin>>tmp;
if (tmp) cout<<"Alice"<<endl;
else cout<<"Bob"<<endl;
}
return ;
}
o(╯□╰)o
hdu4642 Fliping game ——博弈的更多相关文章
- HDU-4642 Fliping game 简单博弈
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4642 看右下角的状态就行了,因为上面的操作每次都会改变它,而最后的局势是根据它来的... //STAT ...
- hdu 4642 Fliping game(博弈)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=4642 题意:给定一个棋盘,0表示向下,1表示向上,选一个x,y, 然后翻转从x,y 到n,m.的所有硬币, ...
- HDU 4642 Fliping game (2013多校4 1011 简单博弈)
Fliping game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tota ...
- HDU 4642 Fliping game (简单博弈)
Fliping game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tota ...
- hdu4642博弈(矩阵)
题意: 给一个01矩阵,每次可以选择1的格子,选择之后以他为左上角的矩阵全都取反,两个人轮班取,不能取的人输. 思路: 博弈的题目,结论是右下角是0就输,1就赢,原因可以这么 ...
- HDU4642博弈好题
链接:http://acm.hdu.edu.cn/ 两个人进行翻棋游戏,若a[n][m]为1,则不管先手就可以翻a[n][m]使其为0,这样不管后手翻什么都会使得a[n][m]为1,先手总是有棋可翻: ...
- hdu----(1849)Rabbit and Grass(简单的尼姆博弈)
Rabbit and Grass Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- HDU 5754 Life Winner Bo 组合博弈
Life Winner Bo Problem Description Bo is a "Life Winner".He likes playing chessboard gam ...
- HDU 2509 Nim博弈变形
1.HDU 2509 2.题意:n堆苹果,两个人轮流,每次从一堆中取连续的多个,至少取一个,最后取光者败. 3.总结:Nim博弈的变形,还是不知道怎么分析,,,,看了大牛的博客. 传送门 首先给出结 ...
随机推荐
- 一看就懂的ReactJs入门教程(精华版)
一看就懂的ReactJs入门教程(精华版) 现在最热门的前端框架有AngularJS.React.Bootstrap等.自从接触了ReactJS,ReactJs的虚拟DOM(Virtual DOM)和 ...
- Rhel6-tomcat+nginx+memcached配置文档
理论基础: User - > web ->nginx ->tomcat1 ->*.jsp 80 8080 ↓ -> tomcat2 html ...
- get( )与getline( )区别
get与getline区别不是很大,但一个明显的区别是get遇到 '\n '字符后便返回,这是 '\n '还在缓冲区中,所以下次读出来的将是 '\n ',而getline遇到 '\n '也返回,但它会 ...
- System.Web.HttpRequestBase转HttpWebRequest
/// <summary> /// Copies all headers and content (except the URL) from an incoming to an outgo ...
- 上架app 到app store 的出现: “The IPA is invalid. It does not inlude a Payload directory.”错误处理
今天打包上传app到app store上遇到的一个错误,在xcode6.2下提示: The IPA is invalid. It does not inlude a Payload director ...
- Integer 和int
获取Integer对象有两种方式:Integer x = 100:或者Integer x = new Integer(100): Integer x = 100:等价于Integer x = Inte ...
- UIButton 点击后变灰
+(UIButton *)getBlueButtonWithTitle:(NSString *)aTitle{ UIButton *button = [UIButton buttonWithType: ...
- hdu 2075
PS:水得不能再水..刚开始还以为是大数..要用到快速幂...谁知道想太多...就普通int型.. 代码: #include "stdio.h" int main(){ int a ...
- [IE兼容性] Table 之边框 (IE6 IE7 IE8(Q) 中 cellspacing 属性在重合的边框模型的表格中仍然有效)
在 IE6 IE7 IE8(Q) 中,在通过 border-collapse:collapse 使用表格的重合边框模型后,其 cellspacing 属性仍然有效: 在 其他浏览器 中,此时的 cel ...
- OpenSesame:一个能够攻击fixed-pin设备的工具
OpenSesame是一种设备,这种设备可以通过无线技术来打开任何一个设有固定密码的车库门,我从中发现了一个攻击无线固定pin码设备的新方法. 演示视频以及详细信息: opensesame源代码:ht ...