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. nuget的小Tips

    1.nuget常用命令 nuget spec -a bin\Debug\DllName.dll -f //根据dll生成.nuspec文件,这样会生成无用的默认标签,比如licenseUrl.tags ...

  2. json数组,随便测试

    Pid := '1001411225514227,926792194654225'; json := SA([]); json.AsArray.Add(SO(pid)); ShowMessage( j ...

  3. COJ 1287 求匹配串在模式串中出现的次数

    这里要在后缀自动机的节点中维护一个从到达当前位置出现的字符串总个数 这里新添加进来的节点的状态出现的次数必然为1 另外包含所能达到这个节点所能到达的状态一定是将它作为父亲的点 那么说明将它作为父亲的点 ...

  4. [转] Android应用程序与SurfaceFlinger服务的关系概述和学习计划

    转自:Android应用程序与SurfaceFlinger服务的关系概述和学习计划 SurfaceFlinger服务负责绘制Android应用程序的UI,它的实现相当复杂,要从正面分析它的实现不是一件 ...

  5. 记录一些容易忘记的属性 -- UIKeyboard

    //UIKeyboardWillShowNotification这个通知在软键盘弹出时由系统发送    //UIKeyboardWillShowNotification 通知:键盘将要显示的通知    ...

  6. AJAX笔记

    浏览器脚本——AJAX AJAX =  异步的 JavaScript 和 XML(Asynchronous JavaScript and XML). 是一种新的技术,它可以创建更好.更快且交互性更强的 ...

  7. 【PyQt5】学习笔记(1)

    # -*- coding: utf-8 -*- from PyQt5 import QtWidgets,QtCore #从pyqt库导入QtWindget通用窗口类 from formnew impo ...

  8. C++使用POST方法向网页提交数据-----C++发送HTTP数据获取Google天气预报

    例1:C++使用POST方法向网页提交数据    转自:http://www.it165.net/pro/html/201208/3534.html 在C++中可以使用POST方法向网页中提交数据,这 ...

  9. BZOJ 4011 落忆枫音

    几个重点: 1.从每个点任选一条入边,都可以成为一个树形图. 2.于是考虑所有答案减去有环的答案. 3.将要求的东西形式化表示出来,然后发现可以直接dp.. 好厉害啊.. #include<io ...

  10. linux下vi命令

    Vi共分三种模式,分别是“一般模式”.“编辑模式”与“命令行命令模式”. 1.一般模式:vi处理文件时,一进入该文件就是一般模式.在这个模式中,可以使用“上下左右”键来移动光标,可以使用“删除字符”或 ...