读书人

hdu1730 Northcott Game 变换为距离N

发布时间: 2012-09-10 22:20:12 作者: rapoo

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!"); }}

读书人网 >编程

热点推荐