結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー brthyyjp
提出日時 2021-08-11 15:00:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 575 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 82,180 KB
実行使用メモリ 53,744 KB
最終ジャッジ日時 2024-09-25 01:49:38
合計ジャッジ時間 1,726 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

y, m, d = map(int, input().split('/'))
uruu = False
if y%4 == 0 and not (y%100 == 0 and y%400 != 0):
    uruu = True
nd = d+2
if m == 2:
    if uruu:
        if nd > 29:
            nd %= 29
            m += 1
    else:
        if nd > 28:
            nd %= 28
            m += 1
elif m in {4, 6, 9, 11}:
    if nd > 30:
        nd %= 30
        m += 1
elif m != 12:
    if nd > 31:
        nd %= 31
        m += 1
else:
    if nd > 31:
        y += 1
        m = 1
        nd %= 31
y, m, d = str(y), str(m), str(nd)
ans = y.zfill(4)+'/'+m.zfill(2)+'/'+d.zfill(2)
print(ans)
0