Knight Games
2015-12-01 14:49
309 查看
Knight Games | ||||||
| ||||||
Description | ||||||
The knight in the chessboard has a unique L-shaped move: two squares in one direction either horizontally or vertically, and one square in another direction perpendicular to the first. The knight captures any pieces that it lands on at the end of its L-shaped move. Leyni and XianGe are playing a game on the n * n chessboard. The rules are: 1. They take turns to put a new Knight on the board. 2. There is no pair of the Knights could capture each other. 3. The one who can’t put a new Knight loses. 4. Leyni puts first. Leyni wonders whether he can win the game no matter how XianGe plays. | ||||||
Input | ||||||
There are multiple test cases. The first line of input is an integer T indicating the number of test cases. Then T test cases follow. For each test case: Line 1. This line contains an integer n (1 ≤ n ≤ 109) indicating the size of the chessboard. | ||||||
Output | ||||||
For each test case: Line 1. Output "YES" if Leyni can win no matter how XianGe plays, otherwise output "NO". | ||||||
Sample Input | ||||||
2 1 2 | ||||||
Sample Output | ||||||
YES NO | ||||||
Source | ||||||
哈理工2012春季校赛 - 现场赛(热身) |
#include<cstdio> #include<cmath> #include<queue> #include<iostream> #include<algorithm> using namespace std; int main() { int T; while(~scanf("%d",&T)) { while(T--) { long n; scanf("%ld",&n); if(n%2==0) { printf("NO\n"); } else { printf("YES\n"); } } } return 0; }
相关文章推荐
- iOS block在两个页面间的简单传值
- WORD 不能使用ctrl跟踪连接,出现由于本机的限制,该操作已被取消,请与系统管理员联系
- Gradle 第一讲 之 准备工作
- Surge SS模块MD5验证
- StringUtils 的用法
- Hello PyUnitTest
- [GIT].gitconfig配置
- 5+plus教程-2-mui
- 关于的servlet的单例模式解释
- v7.widget.SearchView的使用
- spring mvc 和mybatis整合 的异常处理
- Ubuntu系统安装php开发环境
- 分布式事务——Spring.ChainedTransactionManager
- 【Struts2】(4)复杂对象传递
- 跨平台开源通讯组件elastic communication
- linux 下文件加密压缩和解压的方法
- redis-cluster研究和使用
- 读书笔记---《即学即用财务常识120例》
- AngulaJs+Web Api Cors 跨域访问失败的解决办法
- My-utils(续)