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 ...
随机推荐
- HDFS 冗余数据保存
- bert 预训练模型路径
google的bert预训练模型: BERT-Large, Uncased (Whole Word Masking): 24-layer, 1024-hidden, 16-heads, 340M pa ...
- js 高亮显示关键字
示例: var defaultEmphasisHandler = function(keyword, data){ var regex = RegExp("("+keyword.r ...
- 【python之路36】进程、线程、协程相关
线程详细用法请参考:http://www.cnblogs.com/sunshuhai/articles/6618894.html 一.初始多线程 通过下面两个例子的运行效率,可以得知多线程的速度比单线 ...
- bzoj 1266 [AHOI2006] 上学路线
传送门 传说中的经典容斥+卢卡斯定理+中国剩余定理 题解传送门 //Achen #include<algorithm> #include<iostream> #include& ...
- H5C3--圆角
/*添加圆角 规律:顺时针方向 一个值:代表四个方向 二个值:左上+右下 / 右上+左下 三个值:左上 / 右上+左下 / 右下 四个值:左上/ 右上 / 右下/ 左下*/ /*border-radi ...
- 在网站制作过程中发现的block和inline-block不同。
inline-block,简单来说就是在CSS中通过display:inline-block对一个对象指定inline-block属性,可以将对象呈递为内联对象,但是对象的内容作为块对象呈递.有时既希 ...
- [LOJ2114][HNOI2015]-菜肴制作-拓扑排序+贪心
<题面> 一个蒟蒻的痛苦一天 在今天的节目集训中,麦蒙将带领大家学习9种错误的解题策略 $15\%$算法(看两个就往下走吧) 1> puts("Impossible!&qu ...
- SpringBoot+Shiro+mybatis整合实战
SpringBoot+Shiro+mybatis整合 1. 使用Springboot版本2.0.4 与shiro的版本 引入springboot和shiro依赖 <?xml version=&q ...
- java并发系列(六)-----Java并发:volatile关键字解析
在 Java 并发编程中,要想使并发程序能够正确地执行,必须要保证三条原则,即:原子性.可见性和有序性.只要有一条原则没有被保证,就有可能会导致程序运行不正确.volatile关键字 被用来保证可见性 ...