結果

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

ソースコード

diff #

y, m, d = map(int, input().split('/'))
uruu = False
if (y%4 == 0 and not (y%100 == 0 & 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