hdu 1851 A Simple Game Java 水题系列 博弈
2015-08-15 14:26
706 查看
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1851
import java.io.*; import java.math.*; import java.util.*; public class Main{ public static void main(String argv[]){ Scanner cin = new Scanner(System.in); int T,A,L; int n,ans; T = cin.nextInt(); while(T > 0){ T -- ; ans = 0; n = cin.nextInt(); for(int i = 1 ; i <= n ; i++) { A = cin.nextInt(); L = cin.nextInt(); ans = ans ^ (A % (L + 1)); } // System.out.println(ans); if(ans == 0) System.out.println("Yes"); else System.out.println("No"); } } }
相关文章推荐
- 拓扑排序算法
- 普里姆算法,克鲁斯卡尔算法
- spring mvc poi excel
- MyEclipse eclipse 修改注释的作者名字
- struts2集成spring3的原理分析
- 不使用split和replace情况下分割复杂字符串
- Java注解
- Struts2相关知识(一)
- javaWeb用到的检验总结
- 黑马程序员----JDK1.5新特性
- Can not find a java.io.InputStream with the name [downloadFile] in the invocation stack.
- hdu 1877 Java 水题系列
- java中的clone
- Spring MVC学习系列(1)之人生若只如初见
- FreeMarker入门教程
- java语句
- Spring入门
- [JAVA第二课] java命名规则
- 最长递增子序列 LIS 时间复杂度O(nlogn)的Java实现
- java.lang.NullPointerException Exception details are logged in Window > Show View > Error Log 正确解决方法