水题 ZOJ 3876 May Day Holiday
/*
水题:已知1928年1月1日是星期日,若是闰年加1,总天数对7取余判断就好了;
*/
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <vector>
using namespace std; const int MAXN = 1e4 + ;
const int INF = 0x3f3f3f3f;
int cnt[MAXN]; void leap(void)
{
memset (cnt, , sizeof (cnt)); for (int i=; i<=; ++i)
{
if ((i % == && i % != ) || i % == )
cnt[i] = ;
}
} int main(void) //ZOJ 3876 May Day Holiday
{
//freopen ("H.in", "r", stdin); int t; leap ();
scanf ("%d", &t);
while (t--)
{
int year, day;
scanf ("%d", &year); day = (year - ) * ;
for (int i=; i<=year; ++i)
day += cnt[i];
day += ( + + + ); int ans = day % ;
if(ans == ) printf("6\n");
else if(ans == || ans == || ans == || ans == ) printf("5\n");
else if(ans == ) printf("9\n");
else if(ans == ) printf("6\n");
} return ;
}
水题 ZOJ 3876 May Day Holiday的更多相关文章
- 水题 ZOJ 3875 Lunch Time
题目传送门 /* 水题:找排序找中间的价格,若有两个,选价格大的: 写的是有点搓:) */ #include <cstdio> #include <iostream> #inc ...
- 水题 ZOJ 3880 Demacia of the Ancients
题目传送门 /* 水题:) */ #include <cstdio> #include <iostream> #include <algorithm> #inclu ...
- 水题 ZOJ 3869 Ace of Aces
题目传送门 水题,找出出现次数最多的数字,若多个输出Nobody //#include <bits/stdc++.h> //using namespace std; #include &l ...
- ZOJ 3876 May Day Holiday
As a university advocating self-learning and work-rest balance, Marjar University has so many days o ...
- ZOJ 3876 May Day Holiday 蔡勒公式
H - May Day Holiday Description As a university advoc ...
- [ACM_水题] ZOJ 3706 [Break Standard Weight 砝码拆分,可称质量种类,暴力]
The balance was the first mass measuring instrument invented. In its traditional form, it consists o ...
- [ACM_水题] ZOJ 3714 [Java Beans 环中连续m个数最大值]
There are N little kids sitting in a circle, each of them are carrying some java beans in their hand ...
- [ACM_水题] ZOJ 3712 [Hard to Play 300 100 50 最大最小]
MightyHorse is playing a music game called osu!. After playing for several months, MightyHorse disco ...
- ZOJ 2679 Old Bill ||ZOJ 2952 Find All M^N Please 两题水题
2679:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1679 2952:http://acm.zju.edu.cn/onli ...
随机推荐
- PXE介绍(PXE+kickstart无人值守安装)
PXE概念 PXE(Pre-boot Execution Environment,预启动执行环境)是由Intel公司开发的最新技术,工作于Client/Server的网络模式,支持工作站通过网络从远端 ...
- HDOJ 1272 并查集
小希的迷宫 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Subm ...
- Python多线程(3)——Queue模块
Queue模块支持先进先出(FIFO)队列,支持多线程的访问,包括一个主要的类型(Queue)和两个异常类(exception classes). Python 2 中的Queue模块在Python ...
- 六间房 繁星 酷我 来疯 秀吧 新浪秀 直播播放器 Live 1.2
适合用于进行录制的时候 特别说明: 安装 falsh play 19 时 不能正常播放 每个按钮都有提示,不详细说明 下载地址 http://pan.baidu.com/s/1i32ETIt 下载地址 ...
- 【python】format函数格式化字符串的用法
来源:http://www.jb51.net/article/63672.htm 自python2.6开始,新增了一种格式化字符串的函数str.format(),可谓威力十足.那么,他跟之前的%型格式 ...
- Codeforces 389B(十字模拟)
Fox and Cross Time Limit: 1000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u Submi ...
- mybatils多次查询问题
@Options(flushCache = true, timeout = 20000)
- Jam的计数法(codevs 1140)
题目描述 Description Jam是个喜欢标新立异的科学怪人.他不使用阿拉伯数字计数,而是使用小写英文字母计数,他觉得这样做,会使世界更加丰富多彩.在他的计数法中,每个数字的位数都是相同的(使用 ...
- Quartus 软件的使用之PLL的使用
练习使用Altera FPGA 内的 PLL IP核: 思路:将clk_50M倍频到clk_100M,然后观察100M时钟. 1.生成PLL的核例化文件,然后调用. 点击NEXT之后,等一会会跳出如下 ...
- mybatis 如何查找表里的某一个字段,然后返回它们的结果集list ?
<select id="findArgByParams" resultType="string" parameterType="map" ...