题目传送门

 /*
水题:已知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的更多相关文章

  1. 水题 ZOJ 3875 Lunch Time

    题目传送门 /* 水题:找排序找中间的价格,若有两个,选价格大的: 写的是有点搓:) */ #include <cstdio> #include <iostream> #inc ...

  2. 水题 ZOJ 3880 Demacia of the Ancients

    题目传送门 /* 水题:) */ #include <cstdio> #include <iostream> #include <algorithm> #inclu ...

  3. 水题 ZOJ 3869 Ace of Aces

    题目传送门 水题,找出出现次数最多的数字,若多个输出Nobody //#include <bits/stdc++.h> //using namespace std; #include &l ...

  4. ZOJ 3876 May Day Holiday

    As a university advocating self-learning and work-rest balance, Marjar University has so many days o ...

  5. ZOJ 3876 May Day Holiday 蔡勒公式

                                                   H - May Day Holiday Description As a university advoc ...

  6. [ACM_水题] ZOJ 3706 [Break Standard Weight 砝码拆分,可称质量种类,暴力]

    The balance was the first mass measuring instrument invented. In its traditional form, it consists o ...

  7. [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 ...

  8. [ACM_水题] ZOJ 3712 [Hard to Play 300 100 50 最大最小]

    MightyHorse is playing a music game called osu!. After playing for several months, MightyHorse disco ...

  9. 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 ...

随机推荐

  1. cnblog可以直接黏贴qq截图,但最好不要偷懒

    秋秋(qq)基本上算是ytkah本人开机后要开的软件了,平时也习惯用Ctrl+Alt+A快捷键来进行截图.很早以前ytkah一个无意间发现cnblog可以直接黏贴qq截图,当时截图后可能是忘记黏贴到其 ...

  2. Python打包程序

    到py2exe的官网下载程序,注意对应的python版本,比如所用的python版本为2.7,那么就下载适配2.7版本的py2exe软件 下载完成后安装(与普通软件安装方式相同) 2 将要转换的pyt ...

  3. [ZJOI3527][Zjoi2014]力

    [ZJOI3527][Zjoi2014]力 试题描述 给出n个数qi,给出Fj的定义如下: 令Ei=Fi/qi.试求Ei. 输入 包含一个整数n,接下来n行每行输入一个数,第i行表示qi. 输出 有n ...

  4. 一段功能齐全的PHP常用重定向代码html+js+header

    /** * 重定向浏览器到指定的 URL * * @param string $url 要重定向的 url * @param int $delay 等待多少秒以后跳转 * @param bool $j ...

  5. 【Spring】Spring系列6之Spring整合Hibernate

    6.Spring整合Hibernate 6.1.准备工作 6.2.示例 com.xcloud.entities.book com.xcloud.dao.book com.xcloud.service. ...

  6. Minimum Path Sum

    Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which ...

  7. annotation(@Retention@Target)详解

    一.注解:深入理解JAVA注解 要深入学习注解,我们就必须能定义自己的注解,并使用注解,在定义自己的注解之前,我们就必须要了解Java为我们提供的元注解和相关定义注解的语法. 1.元注解(meta-a ...

  8. cas单点登录用户名为中文的解决办法

    当用户名为中文时,登录后返回的用户名乱码.解决这个问题只需要在客户端的CAS Validation Filter中添加下配置就行了. <init-param> <param-name ...

  9. Android 中的Resource

    Android与ios相比,各种各样Resource算个独特之处.详情请参见官网Resource Types Resource有许多种,常见的有图像资源,布局资源,等等.每一种资源的位置都是固定的,这 ...

  10. php中重写和final关键字的使用

    为什么把重写和final放在一起,原因就是一条:final的意思是不可更改的,也就是说final定义的东西是不可改变的,下面具体来说一下. 来看一段简单的代码: class BaseClass { f ...