杭州電hdu 1730 Northcott Gameはゲームをします。

483 ワード

http://acm.hdu.edu.cn/showproblem.php?pid=1730
試験が必要な問題
#include <stdio.h>

int abs(int a, int b)
{
	if(a > b)return a - b;
	return b - a;
}

int main()
{
	int t;
	int n, m;
	int a, b;
	while(scanf("%d%d", &n, &m)!=EOF){
		t = 0;
		while(n--){
			scanf("%d%d", &a, &b);
			t = t^(abs(a, b)-1);//  
		}
		if(t == 0)printf("BAD LUCK!
"); else printf("I WIN!
"); } return 0; }