結果

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

ソースコード

diff #

S = input().split("/")
year = int(S[0])
month = int(S[1])
day = int(S[2])

uru = []
for i in range(101) :
    y = 2000 + 4*i
    if (y % 400 != 0) and (y % 100 == 0) :
        continue
    uru.append(y)

last = [">o'ω'o<",31,28,31,30,31,30,31,31,30,31,30,31]

if year in uru :
    last[2] += 1

if day+2 > last[month] :
    day = day+2 - last[month]
    if month == 12 :
        year += 1
        month = 1
    else :
        month += 1
    
else :
    day += 2
    
ans = "{}/{}/{}".format(str(year).zfill(4),str(month).zfill(2),str(day).zfill(2))
print(ans)
0