41192023-03-14 23:23:08kristofVilágnaptár (45 pont)python3Wrong answer 39/4517ms12832 KiB
year, months, day = map(int, input().split())
if months == 12 and day == 31:
    print(year, months, "VN")
elif months == 7 and day == 1:
    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

    #* 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
base39/45
1Accepted0/017ms11204 KiB
2Accepted0/017ms11664 KiB
3Accepted0/017ms11868 KiB
4Accepted2/217ms11904 KiB
5Accepted2/217ms11896 KiB
6Accepted3/317ms11812 KiB
7Accepted3/317ms11912 KiB
8Accepted3/317ms12152 KiB
9Wrong answer0/317ms12064 KiB
10Wrong answer0/317ms12340 KiB
11Accepted3/317ms12328 KiB
12Accepted3/317ms12364 KiB
13Accepted3/317ms12192 KiB
14Accepted3/317ms12260 KiB
15Accepted3/317ms12420 KiB
16Accepted3/317ms12536 KiB
17Accepted3/317ms12720 KiB
18Accepted2/217ms12784 KiB
19Accepted3/317ms12832 KiB