您的位置:首页 > 其它

POJ 2234 Matches Game(博弈)

2016-09-01 14:57 274 查看
http://poj.org/problem?id=2234

裸的NIM

//package acm.poj2234;
import java.util.*;
public class Main {

public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner (System.in);
while(in.hasNext()){
int n = in.nextInt();
int s = 0;
for (int i = 1,x;i <= n;++i){
x = in.nextInt();
s ^= x;
}
if (s!=0){
System.out.println("Yes");
}else {
System.out.println("No");
}
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  博弈