#B. 黑色星期五

    Type: Default 1000ms 256MiB

黑色星期五

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

13号又是星期五是一个不寻常的日子吗?

13号在星期五比在其他日少吗?为了回答这个问题,写一个程序来计算在n年里13日落在星期一,星期二......星期日的次数.这个测试从1900年1月1日到1900+n-1年12月31日,n是一个非负数且不大于400。

这里有一些你要知道的:

(1) 1900年1月1日是星期一。

(2) 4,6,11和9月有30天,其他月份除了2月有31天.闰年2月有29天,平年2月有28天。

(3) 年份可以被4整除的为闰年(1992=4*498 所以 1992年是闰年,但是1990年不是闰年)。

(4) 以上规则不适合于世纪年,可以被400整除的世纪年为闰年,否则为平年.所以,1700,1800,1900和2100年是平年,而2000年是闰年。

输入格式

一个整数n。

输出格式

七个在一行且相分开的整数,它们代表13日是星期六,星期日,星期一.....星期五的次数。

20
36 33 34 33 35 35 34

黑猫白银级公开赛06

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2024-5-10 16:00
End at
2024-5-19 0:00
Duration
200 hour(s)
Host
Partic.
16