結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー gorugo30gorugo30
提出日時 2021-02-23 11:59:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 612 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 51,820 KB
最終ジャッジ日時 2023-10-22 06:34:02
合計ジャッジ時間 1,803 ms
ジャッジサーバーID
(参考情報)
judge9 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,820 KB
testcase_01 AC 40 ms
51,820 KB
testcase_02 AC 39 ms
51,820 KB
testcase_03 AC 40 ms
51,812 KB
testcase_04 AC 39 ms
51,812 KB
testcase_05 AC 39 ms
51,812 KB
testcase_06 AC 38 ms
51,820 KB
testcase_07 AC 39 ms
51,816 KB
testcase_08 AC 39 ms
51,816 KB
testcase_09 AC 38 ms
51,808 KB
testcase_10 AC 39 ms
51,812 KB
testcase_11 AC 39 ms
51,808 KB
testcase_12 AC 38 ms
51,812 KB
testcase_13 AC 40 ms
51,812 KB
testcase_14 AC 39 ms
51,812 KB
testcase_15 AC 39 ms
51,808 KB
testcase_16 AC 39 ms
51,812 KB
testcase_17 AC 40 ms
51,816 KB
testcase_18 AC 39 ms
51,816 KB
testcase_19 AC 39 ms
51,812 KB
testcase_20 AC 39 ms
51,812 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 % 400 == 0 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