結果

問題 No.721 Die tertia (ディエ・テルツィア)
コンテスト
ユーザー takakin
提出日時 2020-04-18 22:47:00
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 710 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 532 ms
コンパイル使用メモリ 20,700 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2026-04-19 23:46:06
合計ジャッジ時間 6,066 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input=lambda: sys.stdin.readline().rstrip()
S=[4,6,9,11]
S=set(S)
y,m,d=map(int,input().split("/"))
l=0
if y%4==0:
  if y%100==0:
    if y%400==0:
      l=1
    else:
      l=0
  else:
    l=1
if m==2:
  if d+2>28+l:
    ans=str(y)+"/03/0"+str(d+2-28-l)
  else:
    ans=str(y)+"/02/"+(str(d+2).zfill(2))
elif m in S:
  if d+2>30:
    ans=str(y)+"/"+(str(m+1).zfill(2))+"/"+(str(d+2-30).zfill(2))
  else:
    ans=str(y)+"/"+(str(m).zfill(2))+"/"+(str(d+2).zfill(2))
elif m==12 and d>=30:
  ans=str(y+1)+"/01/"+(str(d+2-31).zfill(2))
else:
  if d+2>31:
    ans=str(y)+"/"+(str(m+1).zfill(2))+"/"+(str(d+2-31).zfill(2))
  else:
    ans=str(y)+"/"+(str(m).zfill(2))+"/"+(str(d+2).zfill(2))
print(ans)


0