闰年判断
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.
题目描述
地球绕太阳公转一圈大约是 天。为了让日历和季节对得上,人们规定:
- 能被 整除,但不能被 整除的年份是闰年(例如 年);
- 能被 整除的年份也是闰年(例如 年);
- 其余年份都是平年(例如 年、 年)。
闰年有 天,平年有 天。
给定一个年份 ,请你判断它是闰年还是平年。
输入格式
一行一个整数 ,表示年份。
输出格式
一行一个字符串:如果 是闰年输出 YES,否则输出 NO(都用大写字母)。
2024
YES
1900
NO
2000
YES
数据范围与提示
【样例解释】
- 样例 1: 能被 整除,且不能被 整除,所以是闰年,输出
YES。 - 样例 2: 能被 整除,但它能被 整除、却不能被 整除,
所以它是平年,输出
NO。这是最容易错的一个年份。 - 样例 3: 能被 整除,所以是闰年,输出
YES。
【数据范围】
对于所有测试数据,保证 。
HIL2026年9月入门组
- Status
- Done
- Rule
- IOI
- Problem
- 4
- Start at
- 2026-9-29 10:30
- End at
- 2026-10-7 18:30
- Duration
- 200 hour(s)
- Host
- Partic.
- 6