HDU_1079_思维题
Calendar Game
Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 3628    Accepted Submission(s): 2163
A player wins the game when he/she exactly reaches the date of November 4, 2001. If a player moves to a date after November 4, 2001, he/she looses the game.
Write a program that decides whether, given an initial date, Adam, the first mover, has a winning strategy.
For this game, you need to identify leap years, where February has 29 days. In the Gregorian calendar, leap years occur in years exactly divisible by four. So, 1993, 1994, and 1995 are not leap years, while 1992 and 1996 are leap years. Additionally, the years ending with 00 are leap years only if they are divisible by 400. So, 1700, 1800, 1900, 2100, and 2200 are not leap years, while 1600, 2000, and 2400 are leap years.
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std; int main()
{
int n;
scanf("%d",&n);
while(n--)
{
int year,mon,day;
scanf("%d%d%d",&year,&mon,&day);
if((mon+day)%==||((mon==||mon==)&&day==))
printf("YES\n");
else
printf("NO\n");
}
return ;
}
HDU_1079_思维题的更多相关文章
- zoj 3778 Talented Chef(思维题)
		
题目 题意:一个人可以在一分钟同时进行m道菜的一个步骤,共有n道菜,每道菜各有xi个步骤,求做完的最短时间. 思路:一道很水的思维题, 根本不需要去 考虑模拟过程 以及先做那道菜(比赛的时候就是这么考 ...
 - cf A. Inna and Pink Pony(思维题)
		
题目:http://codeforces.com/contest/374/problem/A 题意:求到达边界的最小步数.. 刚开始以为是 bfs,不过数据10^6太大了,肯定不是... 一个思维题, ...
 - ZOJ 3829 贪心 思维题
		
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3829 现场做这道题的时候,感觉是思维题.自己智商不够.不敢搞,想着队友智商 ...
 - 洛谷P4643 [国家集训队]阿狸和桃子的游戏(思维题+贪心)
		
思维题,好题 把每条边的边权平分到这条边的两个顶点上,之后就是个sb贪心了 正确性证明: 如果一条边的两个顶点被一个人选了,一整条边的贡献就凑齐了 如果分别被两个人选了,一作差就抵消了,相当于谁都没有 ...
 - C. Nice Garland  Codeforces Round #535 (Div. 3) 思维题
		
C. Nice Garland time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...
 - PJ考试可能会用到的数学思维题选讲-自学教程-自学笔记
		
PJ考试可能会用到的数学思维题选讲 by Pleiades_Antares 是学弟学妹的讲义--然后一部分题目是我弄的一部分来源于洛谷用户@ 普及组的一些数学思维题,所以可能有点菜咯别怪我 OI中的数 ...
 - UVA 1394 And Then There Was One / Gym 101415A And Then There Was One / UVAlive 3882 And Then There Was One / POJ 3517 And Then There Was One / Aizu 1275 And Then There Was One (动态规划,思维题)
		
UVA 1394 And Then There Was One / Gym 101415A And Then There Was One / UVAlive 3882 And Then There W ...
 - HDU 1029 Ignatius and the Princess IV / HYSBZ(BZOJ) 2456 mode(思维题,~~排序?~~)
		
HDU 1029 Ignatius and the Princess IV (思维题,排序?) Description "OK, you are not too bad, em... But ...
 - cf796c 树形,思维题
		
一开始以为是个树形dp,特地去学了..结果是个思维题 /* 树结构,设最大点权值为Max,则答案必在在区间[Max,Max+2] 证明ans <= Max+2 任取一个点作为根节点,那么去掉这个 ...
 
随机推荐
- HDU 1546 Idiomatic Phrases Game 求助!help!!!
			
Idiomatic Phrases Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/O ...
 - 16、Java并发性和多线程-死锁
			
以下内容转自http://ifeve.com/deadlock/: 死锁是两个或更多线程阻塞着等待其它处于死锁状态的线程所持有的锁.死锁通常发生在多个线程同时但以不同的顺序请求同一组锁的时候. 例如, ...
 - tomcat这种http服务器,是能接收到客户端的断开信息的,并能打印出来
			
如,tomcat的运行文件 DEBUG -- CLOSE BY CLIENT STACK TRACE
 - [Vue @Component] Place Content in Components with Vue Slots
			
Vue's slots enable you to define where content of a component should land when you define the conten ...
 - android开发艺术探索学习 之 结合Activity的生命周期了解Activity的LaunchMode
			
转载请标明出处: http://blog.csdn.net/lxk_1993/article/details/50749728 本文出自:[lxk_1993的博客]: 首先还是先介绍下Activity ...
 - Android之Activity之间传递对象
			
在非常多时候,我们须要在Activity之间传递对象,比方当你点击了某列表的item,须要传递给下一个Activity该对象,那我们须要该怎么做呢? Android支持两种传递对象的方式.一种是bun ...
 - C语言控制台窗体图形界面编程(总结)
			
本系列文章是笔者通过学习<C语言控制台窗体界面编程(修正版)>而写(关于此文档的很多其它信息请看本系列文章第一篇),旨在让大家更加清晰简洁easy地学习C语言控制台窗体界面的编程. 通过本 ...
 - hbase查询_Phoenix及hbase repl命令行两种方式
			
一.Phoenix(jdbc)登陆 1.cd /home/mr/phoenix/bin(此路径每个环境里面有可能不一样)2../sqlline.py localhost 二.shell repl Hb ...
 - FPC报价模块配置   UpdateCommand影响了预期 1 条记录中的 0 条 解决办法
			
今天在增加P4厂 FPC报价模块配置,增加刚挠信息节点,在保存时报错:UpdateCommand影响了预期 1 条记录中的 0 保存时使用:SqlDataAdapter批量更新DataTable,怎么 ...
 - JavaScript--编程
			
第一步:把注释语句注释. 第二步:编写代码,在页面中显示 “系好安全带,准备启航--目标JS”文字: 第三步:编写代码,在页面中弹出提示框“准备好了,起航吧!” 提示: 可以把弹框方法写在函数里. 第 ...