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 ——博弈的更多相关文章

  1. HDU-4642 Fliping game 简单博弈

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4642 看右下角的状态就行了,因为上面的操作每次都会改变它,而最后的局势是根据它来的... //STAT ...

  2. hdu 4642 Fliping game(博弈)

    题目:http://acm.hdu.edu.cn/showproblem.php?pid=4642 题意:给定一个棋盘,0表示向下,1表示向上,选一个x,y, 然后翻转从x,y 到n,m.的所有硬币, ...

  3. HDU 4642 Fliping game (2013多校4 1011 简单博弈)

    Fliping game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tota ...

  4. HDU 4642 Fliping game (简单博弈)

    Fliping game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tota ...

  5. hdu4642博弈(矩阵)

    题意:       给一个01矩阵,每次可以选择1的格子,选择之后以他为左上角的矩阵全都取反,两个人轮班取,不能取的人输. 思路:        博弈的题目,结论是右下角是0就输,1就赢,原因可以这么 ...

  6. HDU4642博弈好题

    链接:http://acm.hdu.edu.cn/ 两个人进行翻棋游戏,若a[n][m]为1,则不管先手就可以翻a[n][m]使其为0,这样不管后手翻什么都会使得a[n][m]为1,先手总是有棋可翻: ...

  7. hdu----(1849)Rabbit and Grass(简单的尼姆博弈)

    Rabbit and Grass Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  8. HDU 5754 Life Winner Bo 组合博弈

    Life Winner Bo Problem Description   Bo is a "Life Winner".He likes playing chessboard gam ...

  9. HDU 2509 Nim博弈变形

    1.HDU 2509  2.题意:n堆苹果,两个人轮流,每次从一堆中取连续的多个,至少取一个,最后取光者败. 3.总结:Nim博弈的变形,还是不知道怎么分析,,,,看了大牛的博客. 传送门 首先给出结 ...

随机推荐

  1. 如何获取google可以访问的IP地址

    由于某些原因,google的部分网站无法打开,导致我们的好些资源都无法找到,今天在网上看到一篇文件,教大家如何能找到可以访问的google. 假如我们需要访问的是:https://code.googl ...

  2. matlab中如何保留指定的变量的数据

    在使用matlab时,通常要将计算的结果保存到mat文件中.使用的命令是: save filename 但是用上述命令保存的时候,会将计算过程中的其他变量一起保存了.这中粗糙的保存有以下缺点: (1) ...

  3. SharePoint 沙盒解决方案 VS 场解决方案

    博客地址 http://blog.csdn.net/foxdave 最近看书正好看到了关于沙盒解决方案的介绍,便整理记录一下. 虽然沙盒解决方案已经在最新的SharePoint开发中被否决弃用了(被A ...

  4. sql server日志不能shrink或truncate

    Backup log [dbxxx] with truncate_only sql server 2008之后不支持此操作,需要改为: BACKUP LOG dbxxx TO DISK='NUL:' ...

  5. table td的宽度详解

    前言:一直总觉得td的宽度好难驾驭,但万事万物总是有规律的.就像亮剑说的:不用因为怕八路就敬而远之,应该靠上去,熟悉他们,了解他们.   正文:           Table只有Table的宽度是可 ...

  6. struts2+hibernate整合开发步骤

    百度的各种代码,步骤,自己整合了一下 1,创建数据库 常用mysql   creat table..... 2,在WebContent下的bin中添加相应的包 http://pan.baidu.com ...

  7. 从对SAE的一次授权安全评估浅谈云安全

      EMail: jianxin#80sec.comSite: http://www.80sec.comDate: 2011-12-20From: http://www.80sec.com/ [ 目录 ...

  8. Ch2.Making Reconmmendation in PCI

    做<Programing Collective Intelligence>中chapter 2.Making Recommendation的实例,有3个问题花了好长时间: 1. 遇到报错& ...

  9. 第一课~Django~简介

    Django一个可以是Web开发工作者开发工作愉快并且高效的Web 框架 . 使用Django , 使你能够以最小的代建构建和维护高质量的Web应用 . 从好的方面来看 , Web开发激动人心并且富有 ...

  10. ACDream-C - Transformers' Mission(Dijastra最短路径)

    dijstra求最短路径:经典应用题目: 题意:给你一个带权值无向图,权值是A点到B点的时间,然后告诉你起点,一个人可以去炸掉一个结点或多个节点,也可以派多个人,最终这些人在终点集合,问最后一个到达终 ...