57682023-09-24 00:55:29KezdőEgykorúak (75 pont)python3Wrong answer 55/75131ms13584 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-1]) + n
    for j in range(1950,e):
        if j%4==0:
            nap += 1
    if e%4==0 and h>2:
        nap += 1
    if h==2 and n==29:
        nap += 1
    if i == 0:
        P = nap
##    print(nap-P)
    if abs(P-nap) <= 365:
        s += 1
print(s)
SubtaskSumTestVerdictTimeMemory
base55/75
1Accepted0/018ms11140 KiB
2Accepted0/0131ms11608 KiB
3Accepted5/517ms11464 KiB
4Accepted5/517ms11832 KiB
5Accepted5/517ms12124 KiB
6Accepted5/517ms12276 KiB
7Accepted5/517ms12404 KiB
8Accepted5/518ms12468 KiB
9Accepted5/519ms12492 KiB
10Wrong answer0/539ms12812 KiB
11Accepted5/541ms13004 KiB
12Accepted5/550ms12984 KiB
13Wrong answer0/561ms13132 KiB
14Accepted5/570ms13176 KiB
15Wrong answer0/586ms13224 KiB
16Wrong answer0/596ms13584 KiB
17Accepted5/5119ms13444 KiB