41252023-03-14 23:46:30kristofVilágnaptár (45 pont)python3Accepted 45/4517ms13836 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")

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
        new[5] += 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)
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/017ms11180 KiB
2Accepted0/017ms11368 KiB
3Accepted0/017ms11532 KiB
4Accepted2/217ms11996 KiB
5Accepted2/217ms12072 KiB
6Accepted3/317ms12316 KiB
7Accepted3/317ms12556 KiB
8Accepted3/317ms12688 KiB
9Accepted3/317ms12844 KiB
10Accepted3/317ms12916 KiB
11Accepted3/317ms13164 KiB
12Accepted3/317ms13192 KiB
13Accepted3/317ms13368 KiB
14Accepted3/317ms13360 KiB
15Accepted3/317ms13340 KiB
16Accepted3/317ms13096 KiB
17Accepted3/317ms13376 KiB
18Accepted2/217ms13836 KiB
19Accepted3/317ms13628 KiB