hdu4642 Fliping game ——博弈

August 3, 2013
Hdu Math

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[8][2] = {{-1,0},{1,0},{0,-1},{0,1},{-1,-1},{-1,1},{1,-1},{1,1}};
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 = 0; i < t; ++i)
    {
        cin>>n>>m;
        for (int j = 0; j < n; ++j)
        for (int k = 0; k < m; ++k)
        cin>>tmp;
        if (tmp) cout<<"Alice"<<endl;
        else cout<<"Bob"<<endl;
    }
    return 0;
}

o(╯□╰)o

comments powered by Disqus