41232023-03-14 23:37:20kristofVilágnaptár (45 pont)python3Hibás válasz 42/4517ms13440 KiB
year, months, day = map(int, input().split())
if months == 12 and day == 31:
    print(year, months, "VN")
elif months == 7 and day == 1 and year % 4 ==0:
    print(year, 6, "SZN")
elif months == 12 and day == 30 and year % 4 ==0:
    print(year, months, day)

else:
    gregorian = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
    new = [31, 30, 30, 31, 30, 30, 31, 30, 30, 31, 30, 30]

    ind = 0

    if year % 4 == 0:
        gregorian[1] += 1

    #* how may days are there?
    for i in range(months-1):
        ind += gregorian[i]
    ind += day

    #TODO calculate in new calendar
    for i in range(12):
        if ind - new[i] <= 0:
            months = i+1
            break
        else:
            ind -= new[i]
    day = ind



    print(year, months, day)
RészfeladatÖsszpontTesztVerdiktIdőMemória
base42/45
1Elfogadva0/017ms11168 KiB
2Elfogadva0/017ms11272 KiB
3Elfogadva0/017ms11624 KiB
4Elfogadva2/217ms11720 KiB
5Elfogadva2/217ms12032 KiB
6Elfogadva3/317ms12144 KiB
7Elfogadva3/317ms12240 KiB
8Elfogadva3/317ms12120 KiB
9Elfogadva3/317ms12460 KiB
10Hibás válasz0/317ms12580 KiB
11Elfogadva3/317ms12868 KiB
12Elfogadva3/317ms12508 KiB
13Elfogadva3/317ms12752 KiB
14Elfogadva3/317ms13068 KiB
15Elfogadva3/317ms13012 KiB
16Elfogadva3/317ms13168 KiB
17Elfogadva3/317ms13128 KiB
18Elfogadva2/217ms13440 KiB
19Elfogadva3/317ms13264 KiB