57692023-09-24 11:39:58KezdőEgykorúak (75 pont)python3Accepted 75/75128ms13680 KiB
N = int(input())
s = -1
ho = [0,31,28,31,30,31,30,31,31,30,31,30,31]
for i in range(N+1):
    e,h,n = [int(i) for i in input().split()]
    nap = (e-1950)*365 + sum(ho[:h]) + n
    for j in range(1950,e):
        if j%4==0:
            nap += 1
    if e%4==0 and h>2:
        nap += 1
    if i == 0:
        P = nap
    if abs(P-nap) <= 365:
        s += 1
print(s)
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/018ms10888 KiB
2Accepted0/0128ms11388 KiB
3Accepted5/517ms11628 KiB
4Accepted5/517ms12024 KiB
5Accepted5/517ms12264 KiB
6Accepted5/517ms12140 KiB
7Accepted5/517ms12436 KiB
8Accepted5/518ms12096 KiB
9Accepted5/520ms12484 KiB
10Accepted5/539ms12756 KiB
11Accepted5/541ms13000 KiB
12Accepted5/550ms13024 KiB
13Accepted5/561ms13224 KiB
14Accepted5/572ms13184 KiB
15Accepted5/579ms13048 KiB
16Accepted5/596ms13528 KiB
17Accepted5/5109ms13680 KiB