题目传送门

 /*
水题:已知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. MySQL 5.6 Warning: Using a password on the command line interface can be insecure

    MySQL 5.6 在命令行输入密码,就会提示这些安全警告信息. Warning: Using a password on the command line interface can be inse ...

  2. Android之项目推荐使用的第三方库,有助于快速开发,欢迎各位网友补充

    1. 使用上拉更多,下拉刷新:https://github.com/JosephPeng/XListView-Android这个是github上面更为火爆的:https://github.com/ch ...

  3. 关于用Max导出Unity3D使用的FBX文件流程注解

    原地址:http://hi.baidu.com/phpstyle/item/c167a4c0694670b10d0a7b87 关于用Max导出Unity3D使用的FBX文件流程注解(转载) (2011 ...

  4. Unity3d 去掉exe版本的边框

    原地址:http://blog.sina.com.cn/s/blog_697b1b8c0101gd4h.html using System; using System.Runtime.InteropS ...

  5. mysql中binary相加的问题

    我在mysql中有这样一段代码 SQL code   ? 1 2 3 4 5 6 7 8 declare @byte1 binary(1) declare @byte2 binary(1) decla ...

  6. JavaScript Math 对象方法

    Math 对象方法 方法 描述 abs(x) 返回数的绝对值. acos(x) 返回数的反余弦值. asin(x) 返回数的反正弦值. atan(x) 以介于 -PI/2 与 PI/2 弧度之间的数值 ...

  7. 查看别人的css

    ie工具栏的“文件”选项选“另存为”到你本地电脑,存下来有两个文件 一个是空间名称命名的文件夹和html网页,文件加里有三个扩展名为.css的文件

  8. 【转】Python 代码调试技巧

    转载自:http://www.ibm.com/developerworks/cn/linux/l-cn-pythondebugger/ Debug 对于任何开发人员都是一项非常重要的技能,它能够帮助我 ...

  9. Java for LeetCode 063 Unique Paths II

    Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How m ...

  10. GCM 发送接收消息 Message Client Server 服务器端,客户端

    GCM 传递参数 最近用了很多时间做GCM,由于碰到很多问题,因此详细做一下记录,以方便各位网友,不用再走我的重复的路.不过我试了一下GCM在国内很不好用.假如开发国外的程序的话,用GCM倒是很不错的 ...