結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー gorugo30gorugo30
提出日時 2021-02-23 11:58:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 612 bytes
コンパイル時間 609 ms
コンパイル使用メモリ 81,784 KB
実行使用メモリ 53,516 KB
最終ジャッジ日時 2023-10-22 06:33:08
合計ジャッジ時間 1,816 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

S = input()
i = S.index("/")
j = S[i + 1:].index("/")
j += i + 1
y = int(S[:i])
m = int(S[i + 1:j])
d = int(S[j + 1:])
d += 2
th = [2, 4, 6, 9, 11]
if m == 2:
    if y % 4 == 400 or (y % 4 == 0 and y % 100 != 0):
        m += (d - 1) // 29
        d = 1 + (d - 1) % 29
    else:
        m += (d - 1) // 28
        d = 1 + (d - 1) % 28
elif m in th:
    m += (d - 1) // 30
    d = 1 + (d - 1) % 30
else:
    m += (d - 1) // 31
    d = 1 + (d - 1) % 31
y += (m - 1) // 12
m = 1 + (m - 1) % 12
print(y, end = "/")
if m < 10:
    print(str(0), end = "")
print(m, end = "/")
if d < 10:
    print(0, end = "")
print(d)
0