116362024-11-02 11:18:58MagyarKendeSZLGVilágnaptár (45 pont)python3Elfogadva 45/4516ms3312 KiB
Y, M, D = map(int, input().split())
A = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] if Y % 4 == 0 else [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
B = [31, 30, 30, 31, 30, 31, 31, 30, 30, 31, 30, 31] if Y % 4 == 0 else [31, 30, 30, 31, 30, 30, 31, 30, 30, 31, 30, 31]

for i in range(M - 1):
    D += A[i]
M = 1
for i in range(12):
    if B[i] < D:
        M += 1
        D -= B[i]
    else:
        break

if M == 6 and D == 31:
    print(Y, M, "SZN")
elif M == 12 and D == 31:
    print(Y, M, "VN")
else:
    print(Y, M, D)
RészfeladatÖsszpontTesztVerdiktIdőMemória
base45/45
1Elfogadva0/016ms3112 KiB
2Elfogadva0/016ms3312 KiB
3Elfogadva0/016ms3128 KiB
4Elfogadva2/216ms3128 KiB
5Elfogadva2/216ms3068 KiB
6Elfogadva3/314ms2976 KiB
7Elfogadva3/316ms3016 KiB
8Elfogadva3/316ms3088 KiB
9Elfogadva3/316ms3136 KiB
10Elfogadva3/316ms3140 KiB
11Elfogadva3/316ms3128 KiB
12Elfogadva3/316ms3128 KiB
13Elfogadva3/316ms3000 KiB
14Elfogadva3/316ms3176 KiB
15Elfogadva3/316ms2976 KiB
16Elfogadva3/314ms2976 KiB
17Elfogadva3/316ms3132 KiB
18Elfogadva2/216ms3064 KiB
19Elfogadva3/316ms3128 KiB