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");
}
}
}
}
裸的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");
}
}
}
}
相关文章推荐
- poj 2234 Matches Game (博弈)
- POJ - 2234 Matches Game【Nim博弈】
- [博弈]POJ 2234 Matches Game
- POJ 2234 Matches Game(Nim博弈裸题)
- POJ 2234 Matches Game (nim博弈裸题)
- POJ 2234 Matches Game(取火柴博弈1)
- POJ 2234-Matches Game(博弈)
- POJ 2234 Matches Game (经典Nim博弈)
- 【 数论 Nim博弈 】POJ 2234 Matches Game
- 2234-Matches Game-博弈
- POJ--2234 Matches Game(尼姆博弈)
- POJ 2234 Matches Game 尼姆博弈
- POJ 2234 —— Matches Game 入门水题
- POJ 2234 Matches Game(博弈论)
- POJ 2234 Matches Game 博弈论
- POJ 2234 Matches Game 尼姆博弈
- poj 2234 博弈-Nim
- POJ-2234:Matches Game(博弈论,异或大法好)
- poj-2234 Matches Game
- POJ-2234-Matches Game