HDOJ 1907 John
(2)游戏的 SG 函数为 0 且游戏中没有单一游戏的 SG 函数大于 1。
John
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 2233 Accepted Submission(s): 1200
Both of players are using optimal game strategy. John starts first always. You will be given information about M&Ms and your task is to determine a winner of such a beautiful game.
Constraints:
1 <= T <= 474,
1 <= N <= 47,
1 <= Ai <= 4747
3
3 5 1
1
1
Brother
|
#include <iostream>
#include <cstdio> #include <cstring> using namespace std; int main() |
* This source code was highlighted by YcdoiT. ( style: Codeblocks )
HDOJ 1907 John的更多相关文章
- hdu 1907 John (anti—Nim)
John Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)http://acm.h ...
- POJ 3480 & HDU 1907 John(尼姆博弈变形)
题目链接: PKU:http://poj.org/problem? id=3480 HDU:http://acm.hdu.edu.cn/showproblem.php? pid=1907 Descri ...
- HDU 1907 John nim博弈变形
John Problem Description Little John is playing very funny game with his younger brother. There is ...
- hdu 1907 John
很简单的博弈论问题!!(注意全是1时是特殊情况) 代码如下: #include<stdio.h> #include<iostream> using namespace std; ...
- hdu 1907 John&& hdu 2509 Be the Winner(基础nim博弈)
Problem Description Little John is playing very funny game with his younger brother. There is one bi ...
- HDU 1907 John(取火柴博弈2)
传送门 #include<iostream> #include<cstdio> #include<cstring> using namespace std; int ...
- HDU - 1907 John 反Nimm博弈
思路: 注意与Nimm博弈的区别,谁拿完谁输! 先手必胜的条件: 1. 每一个小游戏都只剩一个石子了,且SG = 0. 2. 至少有一堆石子数大于1,且SG不等于0 证明:1. 你和对手都只有一种选 ...
- HDU 1907 John (Nim博弈)
John Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submis ...
- hdu 1907 John(anti nim)
John Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submis ...
随机推荐
- 记录我学github的路程(二)
2015-12-09 更新 1,现在,本地有了一个库,你可能会想到GitHub创建一个库,并且关联起来.这样,远程的库既可以当作备份,又可以让其他人通过该仓库来协作. 2,步骤: (1)登录GitHu ...
- Scala之类型参数和对象
泛型 类型边界 视图界定 逆变和协变 上下文界定 源代码 1.泛型 泛型用于指定方法或类可以接受任意类型参数,参数在实际使用时才被确定,泛型可以有效地增强程序的适用性, 使用泛型可以使得类或方法具有更 ...
- node判断文件目录是否存在
'use strict'; //这是一个简单的应用 var path = require('path'); var fs = require("fs") ; global.l = ...
- css的6中居中的方式
请先看blog:http://blog.csdn.net/wolinxuebin/article/details/7615098
- css清楚浮动的几种常用方法
请先看博客:http://www.jb51.net/css/173023.html
- [USACO2005][POJ3171]Cleaning Shifts(DP+线段树优化)
题目:http://poj.org/problem?id=3171 题意:给你n个区间[a,b],每个区间都有一个费用c,要你用最小的费用覆盖区间[M,E] 分析:经典的区间覆盖问题,百度可以搜到这个 ...
- redis学习笔记——(2)
4.Redis中的string类型 String类型是最简单的类型,一个Key对应一个Value,String类型是二进制安全的.Redis的String可以包含任何数据,比如jpg图片或者序列化的对 ...
- 《TCP/IP详解卷1:协议》第11章 UDP:用户数据报协议-读书笔记
章节回顾: <TCP/IP详解卷1:协议>第1章 概述-读书笔记 <TCP/IP详解卷1:协议>第2章 链路层-读书笔记 <TCP/IP详解卷1:协议>第3章 IP ...
- Go语言_时间篇
Go的time包是标准库中的包之一 不用说,几乎是开发必须用到的包之一.time包的说明文档在: http://golang.org/pkg/time/ 先注意下Overview中的一句话: The ...
- 第三次作业——将排课Excel导入系统
031302322 031302316 将教师排课表导入系统 使用powerdesigner设计数据库表格 设计概念模型 打开new -> Conceptual Data Model创建概念模型 ...