思路:直接判断n是不是m+1的倍数,若是先手则输,否则赢。

AC代码

#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <utility>
#include <string>
#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
#define eps 1e-10
#define inf 0x3f3f3f3f
#define PI pair<int, int>
typedef long long LL;
const int maxn = 100 + 5;

int main() {
	int T;
	scanf("%d", &T);
	while(T--) {
		int n, m;
		scanf("%d%d", &n, &m);
		if(n % (m+1)) printf("first\n");
		else printf("second\n");
	}
	return 0;
}

如有不当之处欢迎指出!

HDU - 1846 Brave Game 巴什博弈的更多相关文章

  1. (step8.2.4)hdu 1846(Brave Game——巴什博奕)

    题目大意:输入一个整数t,表示测试用例是.接着输入2个整数n,m.分别表示这堆石头中石头的个数,和每次所能取得最大的石头数.判断那一方为赢家 解题思路: 1)这是一道简单的巴什博弈: 所谓巴什博弈,是 ...

  2. HDU 1846 Brave Game 巴什博奕

    解题报告:Alice和Bob在做一个取石子游戏,有一堆n个石子,然后规定每个人每次最少要去1个石子,最多可以取m个石子,最后一次取完石子的人为胜. 巴什博奕,关键是找到必胜点和必败点,我们可以先列举出 ...

  3. HDU.1846 Brave Game (博弈论 巴什博弈)

    HDU.1846 Brave Game (博弈论 巴什博弈) 题意分析 巴什博奕裸题 博弈论快速入门 代码总览 include <bits/stdc++.h> using namespac ...

  4. HDU 1846 Brave Game(巴什博弈超简单题)

    题目传送:http://acm.hdu.edu.cn/showproblem.php?pid=1846 Problem Description 十年前读大学的时候,中国每年都要从国外引进一些电影大片, ...

  5. HDU 1846 Brave Game(巴什博弈)

    题目链接: 传送门 Brave Game Time Limit: 1000MS     Memory Limit: 65536K 题目描述 各位勇敢者要玩的第一个游戏是什么呢?很简单,它是这样定义的: ...

  6. 题解报告:hdu 1846 Brave Game(巴什博弈)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1846 Problem Description 十年前读大学的时候,中国每年都要从国外引进一些电影大片, ...

  7. HDU 1846 Brave Game (博弈水题)

    题意:中文...你们懂得. 析:这个就是一个水题博弈,就是一个巴什博弈定理,直接就没有变,如果你们看过我写的那个,这个题绝对水过. 附地址:http://www.cnblogs.com/dwtfukg ...

  8. 2013长春网赛 1006 hdu 4764 Stone(巴什博弈)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4764 题意:Tang 和 Jiang 玩一个游戏,轮流写下一个数,Tang先手,第一次Tang只能写[ ...

  9. HDU——1846Brave Game(巴什博弈)

    Brave Game Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

随机推荐

  1. Python起步

    最近研究系统自动化测试想起了一年前有学习Python的想法,借此机会准备抽时间好好学学.为方便以后学习和查询特写以下博客! Python基础 1. Python数据结构 (1)Python字符串 (2 ...

  2. 译-what is cmdlet

    A cmdlet (pronounced "command-let") is a lightweight Windows PowerShell script that perfor ...

  3. 查阅API文档

    Java的API文档:就一句话:应用程序接口 •API (Application Programming Interface,应用程序编程接口)是 Java 提供的基本编程接口. •Java语言提供了 ...

  4. spark-shell 显示乱码

    用spark shell 进入console环境 查看字符集 scala> System.getProperty("file.encoding") res5: String ...

  5. git 不成功

    fatal: Interactive git shell is not enabled.hint: ~/git-shell-commands should exist and have read an ...

  6. shiro权限控制(二):分布式架构中shiro的实现

    前言:前段时间在搭建公司游戏框架安全验证的时候,就想到之前web最火的shiro框架,虽然后面实践发现在netty中不太适用,最后自己模仿shiro写了一个缩减版的,但是中间花费两天时间弄出来的shi ...

  7. bootstrap select2 使用简单介绍

    1. 基本属性配置: $("#select2-id").select2({ templateResult : formatState, // 列表带图片 templateSelec ...

  8. 17_Python装饰器

    一.什么是装饰器 目的:给func()方法,增加一个功能,在fun()执行期间,同时把fun()执行速率机算出来 import time def func(): print('嘻嘻哈哈') start ...

  9. bzoj 4823: [Cqoi2017]老C的方块 [最小割]

    4823: [Cqoi2017]老C的方块 题意: 鬼畜方块游戏不解释... 有些特殊边,有些四个方块组成的图形,方块有代价,删掉一些方块使得没有图形,最小化代价. 比较明显的最小割,一个图形中必须删 ...

  10. 简单认识一下什么是vue-router

    什么是vue-router? 用通俗一点的话来讲,其实就是一个url和组件之间的映射关系,当我们访问不同的url的时候在页面渲染不同的组件 vue-router怎么用? vue-router作为一个v ...