hdu1730 Northcott Game 变换为距离NIM

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