結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー takakintakakin
提出日時 2020-04-18 22:47:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 710 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-14 21:18:52
合計ジャッジ時間 1,653 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,880 KB
testcase_01 AC 31 ms
10,880 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 31 ms
10,880 KB
testcase_04 AC 31 ms
10,880 KB
testcase_05 AC 30 ms
10,880 KB
testcase_06 AC 30 ms
10,880 KB
testcase_07 AC 30 ms
10,880 KB
testcase_08 AC 31 ms
10,880 KB
testcase_09 AC 30 ms
10,880 KB
testcase_10 AC 31 ms
10,752 KB
testcase_11 AC 30 ms
10,752 KB
testcase_12 AC 30 ms
10,880 KB
testcase_13 AC 32 ms
10,880 KB
testcase_14 AC 30 ms
10,880 KB
testcase_15 AC 31 ms
10,880 KB
testcase_16 AC 30 ms
10,880 KB
testcase_17 AC 31 ms
10,880 KB
testcase_18 AC 30 ms
10,880 KB
testcase_19 AC 31 ms
10,880 KB
testcase_20 AC 30 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

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