hdu1730 尼姆博弈
抽象一下把距离当做石子个数。虽然在这里石子个数可以增加,但是不管怎么增加,不会影响结果,因为你增加了,必须会有减少的。
所以类似取石子,观察平衡状态,如果(x2-x1-1)^...==0,必输。
wa好几发,绝对值忘加了!
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
int i,j,n,m;
while(scanf("%d%d",&n,&m)!=EOF)
{
int ans=;
int ret;
int num=;
for(i=;i<n;i++)
{
int x1,x2;
scanf("%d%d",&x1,&x2);
ret=abs(x2-x1)-;
ans^=ret;
}
if(ans==)
{
printf("BAD LUCK!\n");
}
else
{
printf("I WIN!\n");
}
}
}
hdu1730 尼姆博弈的更多相关文章
- hdu----(1849)Rabbit and Grass(简单的尼姆博弈)
Rabbit and Grass Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- hdu 1849(Rabbit and Grass) 尼姆博弈
Rabbit and Grass Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- Being a Good Boy in Spring Festival 尼姆博弈
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Descr ...
- HDU 4315 Climbing the Hill (阶梯博弈转尼姆博弈)
Climbing the Hill Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u Su ...
- Light OJ 1393 Crazy Calendar (尼姆博弈)
C - Crazy Calendar Time Limit:4000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Su ...
- LightOJ 1247 Matrix Game (尼姆博弈)
A - Matrix Game Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submi ...
- Light OJ 1253 Misere Nim (尼姆博弈(2))
LightOJ1253 :Misere Nim 时间限制:1000MS 内存限制:32768KByte 64位IO格式:%lld & %llu 描述 Alice and Bob ar ...
- hdu-------(1848)Fibonacci again and again(sg函数版的尼姆博弈)
Fibonacci again and again Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Jav ...
- BestCoder Round #65 hdu5591(尼姆博弈)
ZYB's Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total ...
随机推荐
- KOA 学习(八) koa-bodyparser
此控件支持Josn,form,text类型 用法 var Koa = require('koa'); var bodyParser = require('koa-bodyparser'); var a ...
- tensorflow/model下的各个参数的理解
首先,这个对应的proto就是 然后config里面的image_resizer等等 就是proto里面的image_resizer 等等,对应的参数可以在proto里面寻找解释和默认值以及类型 再比 ...
- BZOJ2982: combination Lucas模板
2982: combination Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 734 Solved: 437[Submit][Status][Di ...
- xshell评,xftp估过期解决办法
去官网 xshell:https://www.netsarang.com/download/down_form.html?code=522 xftp:https://www.netsarang.com ...
- Mac下,spacy配置
pip3 install -U spacy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com python3 -m spa ...
- didFailWithError: Error Domain=kCLErrorDomain Code=0 “The operation couldn’t be completed. (kCLError
This error also occurs if you have Scheme/Edit Scheme/Options/Allow Location Simulation checked but ...
- Java review-basic1
1. Dependency Injection Answer: Any application is composed of many objects that collaborate with ea ...
- java根据list中的对象某个属性排序
1. Collections.sort public class Test { public static void main(String[] args) throws Exception { Ci ...
- Hdu 3603
Coach Yehr’s punishment Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/ ...
- FPGA按键功能
1.如何判断按键成功按下? 2.在什么时候采集数据? 按键在按下的过程中会产生大约2ms-3ms抖动,如果此时此刻采集数据来判断按键是不准确的,那么为了采集到准确的数据需要设置一个大约10ms左右的计 ...