結果

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

テストケース

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

ソースコード

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 == 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