QOJ.ac

QOJ

Limite de temps : 1.0 s Limite de mémoire : 512 MB Points totaux : 100 Hackable ✓

#16850. 数学日历

Statistiques

路西亚周四参加编程社团,周一参加数学社团。新年时,社团中表现优秀的学生收到了一本精美的口袋日历作为礼物。路西亚也收到了一本。

路西亚喜欢寻找不同的规律。在研究了日历之后,她发现,在新的一年里,冬季的星期四天数比冬季的星期一天数多 $2$ 天。路西亚意识到,如果她知道关于这一年的这个条件,以及新的一年不是闰年这一事实,她就可以唯一地确定任何给定日期(月和日)是星期几。路西亚解决了这个问题,并邀请你也来解决它。

提示:冬季月份为 12 月、1 月和 2 月。在非闰年中,1 月、3 月、5 月、7 月、8 月、10 月和 12 月有 31 天,4 月、6 月、9 月和 11 月有 30 天,2 月有 28 天。

输入格式

输入包含一行,为一个字符串——格式为 DD-MM 的日期。

输出格式

输出一个 $1$ 到 $7$ 之间的整数——对应给定日期的星期几,其中 $1$ 代表星期一,$7$ 代表星期日。

样例

输入样例 1

16-12

输出样例 1

3

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.