116352024-11-02 11:13:37MagyarKendeSZLGVilágnaptár (45 pont)python3Accepted 45/4517ms3392 KiB
DL   = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
LDL  = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
WDL  = [31, 30, 30, 31, 30, 30, 31, 30, 30, 31, 30, 31]
WLDL = [31, 30, 30, 31, 30, 31, 31, 30, 30, 31, 30, 31]

Y, M, D = map(int, input().split())
if Y % 4 == 0:
    for i in range(M - 1):
        D += LDL[i]
    wm = 1
    for i in range(12):
        if WLDL[i] < D:
            wm += 1
            D -= WLDL[i]
        else:
            break
    if wm == 6 and D == 31:
        print(Y, wm, "SZN")
    elif wm == 12 and D == 31:
        print(Y, wm, "VN")
    else:
        print(Y, wm, D)
else:
    for i in range(M - 1):
        D += DL[i]
    wm = 1
    for i in range(12):
        if WDL[i] < D:
            wm += 1
            D -= WDL[i]
        else:
            break
    if wm == 12 and D == 31:
        print(Y, wm, "VN")
    else:
        print(Y, wm, D)
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/016ms3128 KiB
2Accepted0/016ms3064 KiB
3Accepted0/017ms3128 KiB
4Accepted2/216ms3128 KiB
5Accepted2/217ms3128 KiB
6Accepted3/316ms3320 KiB
7Accepted3/317ms3128 KiB
8Accepted3/317ms3128 KiB
9Accepted3/316ms3140 KiB
10Accepted3/316ms3108 KiB
11Accepted3/316ms3060 KiB
12Accepted3/316ms3232 KiB
13Accepted3/316ms3208 KiB
14Accepted3/317ms3392 KiB
15Accepted3/316ms3068 KiB
16Accepted3/316ms3192 KiB
17Accepted3/316ms3128 KiB
18Accepted2/217ms3132 KiB
19Accepted3/317ms3136 KiB