当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1367:Time

题目描述
Let a time point be given as 6 integers y, m, d, h, min, s where 1970 <= y < 2030, 0 < m < 13, 0 < d < 32, 0 <= h < 24, 0 <= min < 60, 0 <= s < 60. Write a program which computes how many periods of a given length fit between two given time points. A period is given by a pair consisting of a positive integer and a word expressing a time unit, i.e. year or month or day or hour or minute or second. Every 4th year is a leap year, except every 100th which is not except every 400 year which is. A length of the year varies according to leap years. The same is true for the month February. Time units always start as usual, e.g., a year starts at 1st January, a month starts at its 1st day, a day starts at 0 hours 0 minutes 0 seconds, etc. A period ends after its last second.
输入解释
The input consists of blocks of lines. Each block has three lines. The first line of a block contains a time point D1 and the second line a time point D2. D1 always precedes D2. All numbers in the lines are separated by one space. You can assume that the given descriptions of time points are correct. The third line contains a time period. There is one space between the number and the word in the period definition on this line. After each block, there is one empty line.
输出解释
The output contains the lines corresponding to the blocks in the input. A line corresponding to a block contains one integer number expressing how many specified periods are contained between the given time points.
输入样例
1997 12 31 23 59 59
1998 1 1 0 0 0
1 second

2000 2 29 0 0 0
2000 2 29 23 59 59
1 day

2000 2 29 0 0 0
2000 3 1 0 0 0
24 hour

1996 12 31 20 30 0
1997 1 1 7 30 0
60 minute

1996 12 31 20 30 0
1997 1 1 7 30 0
1 hour

输出样例
1
0
1
11
10

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 Central Europe 1997

源链接: POJ-1367

最后修改于 2020-10-29T06:02:06+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 10000