結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー maimai8maimai8
提出日時 2019-06-11 10:17:42
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 947 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 10,960 KB
実行使用メモリ 7,896 KB
最終ジャッジ日時 2023-07-28 11:57:03
合計ジャッジ時間 1,538 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,880 KB
testcase_01 WA -
testcase_02 AC 16 ms
7,832 KB
testcase_03 AC 16 ms
7,876 KB
testcase_04 AC 16 ms
7,776 KB
testcase_05 AC 16 ms
7,752 KB
testcase_06 AC 17 ms
7,772 KB
testcase_07 AC 17 ms
7,760 KB
testcase_08 AC 16 ms
7,752 KB
testcase_09 AC 16 ms
7,804 KB
testcase_10 AC 17 ms
7,760 KB
testcase_11 AC 17 ms
7,696 KB
testcase_12 AC 21 ms
7,768 KB
testcase_13 AC 16 ms
7,768 KB
testcase_14 AC 17 ms
7,748 KB
testcase_15 AC 16 ms
7,692 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 16 ms
7,816 KB
testcase_19 AC 16 ms
7,696 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def year(y, m):
    if m == "12":
        m = "01"
        y = int(y) + 1
    else:
        m = int(m) + 1
        m = "0" + str(m) if m < 10 else m
    return y, m
def month (y, m, d, a, b):
    if d <= a:
        d = int(d) + 2
        d = "0" + str(d) if d < 10 else d
    elif d == b:
        y, m = year(y, m)
        d = "01"
    else:
        y, m = year(y, m)
        d = "02"
    return y, m, d
if __name__ == '__main__':
    s = list(input())
    y, m, d = "".join(s[0:4]), "".join(s[5:7]), "".join(s[8:10])
    uruu = False if int(y) / 4 != 0 or (int(y)/100 == 0 and int(y)/400 != 0) else True
    small = ["04", "06", "09", "11"]
    if m in small:
        y, m, d = month(y, m, d, "28", "29")
    elif m == "02":
        if uruu:
            y, m, d = month(y, m, d, "27", "28")
        else:
            y, m, d = month(y, m, d, "26", "27")
    else:
        y, m, d = month(y, m, d, "29", "30")
    print("{}/{}/{}".format(y, m, d))
0