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 任取一个点作为根节点,那么去掉这个 ...
随机推荐
- 源码分析-react3-创建dom
React.createElement class Welcome extends React.Component { constructor(){ super() this.state={ test ...
- linux系统下安装R
一.先通过ssh将R安装包R-3.2.2.tar.gz从本机复制到你的linux虚拟机上的/home下: 二.解压安装包 #tar -zxvf R-3.2.2.tar.gz 三.1).进入到解压后的R ...
- 1.7-BGP③
IBGP的水平分隔原则(Split Horizon Rule): IBGP的水平分割原则:by default,routes learned via IBGP are never propagated ...
- Sparql语言模型(一)
在进行RDF数据查询或描写叙述的时候.Sparql不管从出身.标准抑或操作习惯上都是一个不错的选择.然而对于一个刚開始学习的人来说多多少少有些"禁忌"的意味,操作起来也有点畏首畏尾 ...
- scikit-learn:matplotlib.pyplot经常使用绘图功能总结(1)
參考:http://matplotlib.org/api/pyplot_api.html 绘图功能总结(2):http://blog.csdn.net/mmc2015/article/details/ ...
- Tcl学习之--命名空间
Tcl解释器将全部的命令和全局变量分组管理.这些小组称为命名空间,一个命名空间中的命令和变量不会影响到还有一个命名空间.这些命名空间呈树形组织.一个命名空间的命令能够被还有一个命名空间引入.命名空间树 ...
- FFmpeg滤镜使用指南
文件夹 1. FFmpeg滤镜文档 2. 演示样例 2.1 缩放 2.2 视频加速 2.3 滤镜图,链和滤镜关系 2.4 多个输入覆盖同一个2x2 网格 2.5 转义字符 2. ...
- scrapy xpath中提取多个class值
xpath中没有提供对class的原生查找方法.但是 stackoverflow 看到了一个很有才的回答: This selector should work but will be more eff ...
- Java经典算法之冒泡排序(Bubble Sort)
原理:比较相邻的两个值,将值大的元素交换至右端 思路:依次比较相邻的两个数,将小数放在前面,大数放在后面.即在第一趟:首先比较第1个和第2个数,将小数放前,大数放后.然后比较第2个数和第3个数,将小数 ...
- $stylus美化$
一直在用洛谷 当然不一定是洛谷 其他的网站也可以用 比如说codeforces 还是决定要美化一波 首先去找一个插件 叫做 stylus stylus下载的很多 我不想过多说明. Google和QQ浏 ...