結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー もりを
提出日時 2019-01-03 10:51:15
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 568 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-23 21:37:08
合計ジャッジ時間 1,651 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

y,m,d = map(int,input().split('/'))
d += 2
days = [31,28,31,30,31,30,31,31,30,31,30,31]

def uruu(year):
    """ 閏年判定 """
    if year % 400 == 0:
        return True
    elif year % 4 == 0 and year % 100 == 0:
        return False
    elif year % 4 == 0:
        return True
    else:
        return False

if uruu(y):
    days[1] += 1
if d > days[m-1]:
    d -= days[m-1]
    m += 1
if m > 12:
    m -= 12
    y += 1
res = '0' * (4 - len(str(y))) + str(y) + '/'
res += '0' * (2 - len(str(m))) + str(m) + '/'
res += '0' * (2 - len(str(d))) + str(d)
print(res)
0