41172023-03-14 23:20:29kristofVilágnaptár (45 pont)python3Wrong answer 38/4517ms13732 KiB
year, months, day = map(int, input().split())

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
base38/45
1Accepted0/017ms11192 KiB
2Wrong answer0/017ms11304 KiB
3Wrong answer0/017ms11932 KiB
4Accepted2/217ms11888 KiB
5Wrong answer0/217ms11780 KiB
6Accepted3/317ms12180 KiB
7Accepted3/317ms12272 KiB
8Accepted3/317ms12680 KiB
9Accepted3/317ms12728 KiB
10Wrong answer0/317ms12936 KiB
11Accepted3/317ms12836 KiB
12Accepted3/317ms13048 KiB
13Accepted3/317ms13004 KiB
14Accepted3/317ms12948 KiB
15Accepted3/317ms12976 KiB
16Accepted3/317ms13168 KiB
17Accepted3/317ms13236 KiB
18Wrong answer0/217ms13732 KiB
19Accepted3/317ms13424 KiB