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博弈的变形,还是不知道怎么分析,,,,看了大牛的博客. 传送门 首先给出结 ...
随机推荐
- node.js安装及grunt插件,如何进行脚本压缩
http://gruntjs.com/pluginshttp://gruntjs.com/getting-startedhttp://gruntjs.com/configuring-tasks#glo ...
- ROS语音识别
一.语音识别包 1.安装 安装很简单,直接使用ubuntu命令即可,首先安装依赖库: $ sudo apt-get install gstreamer0.10-pocketsphinx ...
- limit 百万级数据分页优化方法
mysql教程 这个数据库教程绝对是适合dba级的高手去玩的,一般做一点1万 篇新闻的小型系统怎么写都可以,用xx框架可以实现快速开发.可是数据量到了10万,百万至千万,他的性能还能那么高吗? 一点小 ...
- hibernate框架
在之前的DAO开发中,对关系型数据库进行增删改查都是直接通过sql语句,需要人工的进行对象和表之间的转换.而Hibernate提供了对象和表之间进行映射的框架,使得这种转换更加方便. 1.ORM概念 ...
- Program A-归并排序
Description In this problem, you have to analyze a particular sorting algorithm. The algorithm proce ...
- Cisco IOS Software Activation Command Reference
clear license agent : to clear license agent statistics counters or connection statistics (in privil ...
- 用C#感受MongoDB MapReduce之魅力 转
MapReduce这个名词随着hadoop的用户的增多,越来越被人关注.MapReduce可谓MongoDB之中的亮点,我也想深入了解MapReduce,加上MongoDB操作简单,所以就选择了它.M ...
- java,android获取系统当前时间
SimpleDateFormat formatter = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss ");Date curDate = ...
- ArrayList的使用方法【转载】
*** Source URL: http://i.yesky.com/bbs/jsp/view.jsp?articleID=889992&forumID=150 *** 1.什么是ArrayL ...
- java互斥方法
synchronized, lock/unlock, volatile类型变量, atom类, 同步集合, 新类库中的构件: CountDownLatch\CyclicBarric\Semaph ...