注意闰月的部分细节很多。

/*
ID:Starry21
LANG:C++
TASK:friday
*/
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<map>
using namespace std;
#define N 405
int n;
int ans[];
int main()
{
//freopen("friday.in","r",stdin);
//freopen("friday.out","w",stdout);
scanf("%d",&n);
int lw=,m,d=,r;
for(int i=;i<=n;i++)
{
int y=+i-;
if(y%==)
{
if(y%==) r=;
else r=;
}
else if(y%==) r=;
else r=;
//printf("%d %d\n",y,r);
for(m=;m<=;m++)
{
d=d+;
int res=(d+lw-)%;
if(res==) res=;
lw=res;
lw++;lw=lw%;
if(lw==) lw=;
ans[res]++;
if(m==||m==||m==||m==) d=-;
else if(m==||m==||m==||m==||m==||m==||m==) d=-;
else if(m==)
{
if(r) d=-;
else d=-;
}
}
}
printf("%d %d ",ans[],ans[]);
for(int i=;i<;i++)
printf("%d ",ans[i]);
printf("%d\n",ans[]);
return ;
}

USACO 1.2 Friday the Thirteenth的更多相关文章

  1. USACO Section1.1 Friday the Thirteenth 解题报告

    friday解题报告 —— icedream61 博客园(转载请注明出处) -------------------------------------------------------------- ...

  2. USACO . Friday the Thirteenth

    Friday the Thirteenth Is Friday the 13th really an unusual event? That is, does the 13th of the mont ...

  3. USACO Section 1.1-3 Friday the Thirteenth

    Friday the Thirteenth 黑色星期五 13号又是一个星期五.13号在星期五比在其他日子少吗?为了回答这个问题,写一个程序,要求计算每个月的十三号落在周一到周日的次数. 给出N年的一个 ...

  4. Friday the Thirteenth 黑色星期五 USACO 模拟 超级简单做法

    1003: 1.1.3 Friday the Thirteenth 黑色星期五 时间限制: 1 Sec  内存限制: 128 MB提交: 8  解决: 8[提交] [状态] [讨论版] [命题人:外部 ...

  5. USACO Section 1.1 Friday the Thirteenth 解题报告

    题目 题目描述 黑色星期五是否真的是一件不同寻常的事情?按理来说每个月的13号可能是星期一,或者是星期二...或者是星期天,但是黑色星期五的存在让我们不禁开始猜想,难道每个月的13号刚好是星期五的频率 ...

  6. USACO 1.1.3 Friday the Thirteenth 黑色星期五

    Description 13号又是一个星期5.13号在星期五比在其他日子少吗?为了回答这个问题,写一个程序,要求计算每个月的十三号落在周一到周日的次数.给出N年的一个周期,要求计算1900年1月1日至 ...

  7. JZOJ.1002【USACO题库】1.1.3 Friday the Thirteenth黑色星期五

    每日一博第一天! 保持你的决心 题目描述 13号又是星期五是一个不寻常的日子吗? 13号在星期五比在其他日少吗?为了回答这个问题,写一个程序来计算在n年里13 日落在星期一,星期二......星期日的 ...

  8. USACO Training Section 1.1黑色星期五Friday the Thirteenth

    题目描述 13号又是一个星期五.13号在星期五比在其他日子少吗?为了回答这个问题,写一个程序,要求计算每个月的十三号落在周一到周日的次数.给出N年的一个周期,要求计算1900年1月1日至1900+N- ...

  9. USACO Chapter 1 解题总结

    USACO Chapter 1 解题总结 1.1.1 Your Ride Is Here 基本字符串操作,无压力. 1.1.2 Greedy Gift Givers 基础模拟题,弄明白题意,不怕麻烦, ...

随机推荐

  1. flask学习导航主页

    我就学习了网易课堂的知了Flaskk. 十分感谢. └—01-Flask视图和URL ├—课时001.[Flask预热]课程介绍 ├—课时002.[Flask预热]Flask课程准备工作 ├—课时00 ...

  2. Codeforces Round #588 (Div. 2) C. Anadi and Domino(思维)

    链接: https://codeforces.com/contest/1230/problem/C 题意: Anadi has a set of dominoes. Every domino has ...

  3. 最小安装的centos7下安装oracle 12c

    下载 oracal 安装包 进入https://www.oracle.com/index.html  依次选择-->Menu -->Downloads and trials -->D ...

  4. mySql数据重复数据去重

    1.问题来源:数据中由于并发问题,数据存在多次调用接口,插入了重复数据,需要根据多条件删除重复数据: 2.参考博客文章地址:https://www.cnblogs.com/jiangxiaobo/p/ ...

  5. 【Android-关闭所有Activity】关闭activity之前的所有activity,重启actibity

    Android关闭activity之前的所有activity,重启actibity 直接关闭一个activity之前的所有Activity页面 解决方法:清理activity堆栈 Intent ine ...

  6. mysql数据库的主从同步,实现读写分离

    大型网站为了软解大量的并发访问,除了在网站实现分布式负载均衡,远远不够.到了数据业务层.数据访问层,如果还是传统的数据结构,或者只是单单靠一台服务器来处理如此多的数据库连接操作,数据库必然会崩溃,特别 ...

  7. PHP解决h5页面跨域

    前端h5 页面请求后端接口会出现跨域, PHP 只需三行代码即可解决 //解决前端跨域(h5页面) header("Access-Control-Allow-Origin:*"); ...

  8. SSH 中文乱码解决

    在终端执行命令:export LC_ALL=zh_CN.GB2312;export LANG=zh_CN.GB2312是最有效的. 这种方法是临时的,只对当前SSH客户端有效,重启后依然乱码. 1.不 ...

  9. Codeforces 1205C Palindromic Paths (交互题、DP)

    题目链接 http://codeforces.com/contest/1205/problem/C 题解 菜鸡永远做着变巨的梦 然而依然连div1BC题都不会做 要是那天去打cf怕是又要1题滚粗了.. ...

  10. ARTS打卡计划第十四周

    Algorithms: https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/ Review: “How to write ...