抽象一下把距离当做石子个数。虽然在这里石子个数可以增加,但是不管怎么增加,不会影响结果,因为你增加了,必须会有减少的。

所以类似取石子,观察平衡状态,如果(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 尼姆博弈的更多相关文章

  1. hdu----(1849)Rabbit and Grass(简单的尼姆博弈)

    Rabbit and Grass Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  2. hdu 1849(Rabbit and Grass) 尼姆博弈

    Rabbit and Grass Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  3. Being a Good Boy in Spring Festival 尼姆博弈

    Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Descr ...

  4. HDU 4315 Climbing the Hill (阶梯博弈转尼姆博弈)

    Climbing the Hill Time Limit: 1000MS   Memory Limit: 32768KB   64bit IO Format: %I64d & %I64u Su ...

  5. Light OJ 1393 Crazy Calendar (尼姆博弈)

    C - Crazy Calendar Time Limit:4000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Su ...

  6. LightOJ 1247 Matrix Game (尼姆博弈)

    A - Matrix Game Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submi ...

  7. Light OJ 1253 Misere Nim (尼姆博弈(2))

    LightOJ1253 :Misere Nim 时间限制:1000MS    内存限制:32768KByte   64位IO格式:%lld & %llu 描述 Alice and Bob ar ...

  8. hdu-------(1848)Fibonacci again and again(sg函数版的尼姆博弈)

    Fibonacci again and again Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Jav ...

  9. BestCoder Round #65 hdu5591(尼姆博弈)

    ZYB's Game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total ...

随机推荐

  1. HDFS 冗余数据保存

  2. bert 预训练模型路径

    google的bert预训练模型: BERT-Large, Uncased (Whole Word Masking): 24-layer, 1024-hidden, 16-heads, 340M pa ...

  3. js 高亮显示关键字

    示例: var defaultEmphasisHandler = function(keyword, data){ var regex = RegExp("("+keyword.r ...

  4. 【python之路36】进程、线程、协程相关

    线程详细用法请参考:http://www.cnblogs.com/sunshuhai/articles/6618894.html 一.初始多线程 通过下面两个例子的运行效率,可以得知多线程的速度比单线 ...

  5. bzoj 1266 [AHOI2006] 上学路线

    传送门 传说中的经典容斥+卢卡斯定理+中国剩余定理 题解传送门 //Achen #include<algorithm> #include<iostream> #include& ...

  6. H5C3--圆角

    /*添加圆角 规律:顺时针方向 一个值:代表四个方向 二个值:左上+右下 / 右上+左下 三个值:左上 / 右上+左下 / 右下 四个值:左上/ 右上 / 右下/ 左下*/ /*border-radi ...

  7. 在网站制作过程中发现的block和inline-block不同。

    inline-block,简单来说就是在CSS中通过display:inline-block对一个对象指定inline-block属性,可以将对象呈递为内联对象,但是对象的内容作为块对象呈递.有时既希 ...

  8. [LOJ2114][HNOI2015]-菜肴制作-拓扑排序+贪心

    <题面> 一个蒟蒻的痛苦一天 在今天的节目集训中,麦蒙将带领大家学习9种错误的解题策略 $15\%$算法(看两个就往下走吧) 1> puts("Impossible!&qu ...

  9. SpringBoot+Shiro+mybatis整合实战

    SpringBoot+Shiro+mybatis整合 1. 使用Springboot版本2.0.4 与shiro的版本 引入springboot和shiro依赖 <?xml version=&q ...

  10. java并发系列(六)-----Java并发:volatile关键字解析

    在 Java 并发编程中,要想使并发程序能够正确地执行,必须要保证三条原则,即:原子性.可见性和有序性.只要有一条原则没有被保证,就有可能会导致程序运行不正确.volatile关键字 被用来保证可见性 ...