結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー takakin
提出日時 2020-04-18 22:47:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 710 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-04 00:28:47
合計ジャッジ時間 1,824 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

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