码迷,mamicode.com
首页 > 其他好文 > 详细

HDU 1846 Brave Game (博弈水题)

时间:2016-05-25 00:09:25      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:

题意:中文。。。你们懂得。

析:这个就是一个水题博弈,就是一个巴什博弈定理,直接就没有变,如果你们看过我写的那个,这个题绝对水过。

附地址:http://www.cnblogs.com/dwtfukgv/p/5517818.html

看完后就懂了吧,不用说了,直接上代码就OK。

代码如下:

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>

using namespace std;

int main(){
    int n, m, T;  cin >> T;
    while(T--){
        scanf("%d %d", &n, &m);
        if(n % (m+1) != 0)  puts("first");
        else  puts("second");
    }
    return 0;
}

 

http://www.cnblogs.com/dwtfukgv/p/5517818.html

HDU 1846 Brave Game (博弈水题)

标签:

原文地址:http://www.cnblogs.com/dwtfukgv/p/5525402.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!