首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

hdu1730 Northcott Game 变换为距离NIM

2012-09-10 
hdu1730 Northcott Game转换为距离NIMNorthcott GameTime Limit: 1000/1000 MS (Java/Others)Memory Limit

hdu1730 Northcott Game 转换为距离NIM

Northcott GameTime Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1970    Accepted Submission(s): 812


Problem Description

图1

hdu1730 Northcott Game  变换为距离NIM

图2

InputOutputSample InputSample OutputSourceRecommend#include<iostream>#include<cstdlib>#include<stdio.h>using namespace std;int main(){ int n,m; while(scanf("%d%d",&n,&m)!=EOF) { int ans=0; int a,b; for(int i=0;i<n;i++) { scanf("%d%d",&a,&b); ans^=abs(b-a)-1; } if(ans==0) puts("BAD LUCK!"); else puts("I WIN!"); }}

热点排行