116352024-11-02 11:13:37MagyarKendeSZLGVilágnaptár (45 pont)python3Elfogadva 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)
RészfeladatÖsszpontTesztVerdiktIdőMemória
base45/45
1Elfogadva0/016ms3128 KiB
2Elfogadva0/016ms3064 KiB
3Elfogadva0/017ms3128 KiB
4Elfogadva2/216ms3128 KiB
5Elfogadva2/217ms3128 KiB
6Elfogadva3/316ms3320 KiB
7Elfogadva3/317ms3128 KiB
8Elfogadva3/317ms3128 KiB
9Elfogadva3/316ms3140 KiB
10Elfogadva3/316ms3108 KiB
11Elfogadva3/316ms3060 KiB
12Elfogadva3/316ms3232 KiB
13Elfogadva3/316ms3208 KiB
14Elfogadva3/317ms3392 KiB
15Elfogadva3/316ms3068 KiB
16Elfogadva3/316ms3192 KiB
17Elfogadva3/316ms3128 KiB
18Elfogadva2/217ms3132 KiB
19Elfogadva3/317ms3136 KiB