123592024-12-13 10:36:49birozsVilágnaptár (45 pont)python3Wrong answer 33/4517ms3364 KiB
ev,ho,nap = map(int,input().split())
regiho = [31,28,31,30,31,30,31,31,30,31,30,31]
ujho = [31,30,30,31,30,30,31,30,30,31,30,30]
if ev % 4 == 0:
    regiho[1] = 29
aktnap = 0
for i in range(ho-1):
    aktnap += regiho[i]
aktnap += nap


if ho == 12 and nap == 31:
    print(ev,ho,"VN")
elif ev % 4 == 0 and ho == 7 and nap == 1:
    print(ev,6,"SZN")
elif ev % 4 != 0 or (ev % 4 == 0 and ho*10+nap < 71):
    h = 0
    naposszeg = 0
    while naposszeg + ujho[h+1]< aktnap:
        naposszeg += ujho[h]
        h += 1
    n = aktnap - naposszeg
    print(ev,h+1,n)
elif ev % 4 == 0 and ho*10+nap > 71:
    h = 6
    naposszeg = 183
    while naposszeg + ujho[h+1]< aktnap:
        naposszeg += ujho[h]
        h += 1
    n = aktnap - naposszeg
    print(ev,h+1,n)










    
        
SubtaskSumTestVerdictTimeMemory
base33/45
1Accepted0/016ms3128 KiB
2Accepted0/016ms3116 KiB
3Accepted0/016ms3128 KiB
4Accepted2/216ms3096 KiB
5Accepted2/216ms3136 KiB
6Accepted3/316ms3224 KiB
7Accepted3/316ms3128 KiB
8Accepted3/314ms3320 KiB
9Accepted3/317ms3076 KiB
10Wrong answer0/316ms3180 KiB
11Wrong answer0/314ms3128 KiB
12Accepted3/316ms3136 KiB
13Wrong answer0/316ms3128 KiB
14Accepted3/316ms3364 KiB
15Accepted3/316ms3128 KiB
16Accepted3/316ms2960 KiB
17Accepted3/316ms3176 KiB
18Accepted2/214ms2976 KiB
19Wrong answer0/316ms3172 KiB