【CodeForces - 304B】Calendar (前缀和,水题)
題干:
Calendars in widespread use today include the Gregorian calendar, which is the de facto international standard, and is used almost everywhere in the world for civil purposes. The Gregorian reform modified the Julian calendar's scheme of leap years as follows:
Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100; the centurial years that are exactly divisible by 400 are still leap years. For example, the year 1900 is not a leap year; the year 2000 is a leap year.
In this problem, you have been given two dates and your task is to calculate how many days are between them. Note, that leap years have unusual number of days in February.
Look at the sample to understand what borders are included in the aswer.
Input
The first two lines contain two dates, each date is in the format yyyy:mm:dd (1900?≤?yyyy?≤?2038?and yyyy:mm:dd is a legal date).
Output
Print a single integer — the answer to the problem.
Examples
Input
1900:01:01 2038:12:31Output
50768Input
1996:03:09 1991:11:12Output
1579題目大意:
? 給定兩個日期,輸出天數差。
解題報告:
? 又是一道看樣例猜題意的題。。
AC代碼:
? 計算到1990-01-01的日期差,最后作差就行了、
總結
以上是生活随笔為你收集整理的【CodeForces - 304B】Calendar (前缀和,水题)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: rapimgr.exe - rapimg
- 下一篇: 【POJ - 3259 】Wormhol