結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー maimai8maimai8
提出日時 2019-06-12 09:58:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 965 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-17 19:25:55
合計ジャッジ時間 1,423 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
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
    print(uruu)
    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