結果

問題 No.745 letinopia raoha
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-11-26 21:17:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 795 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 10,828 KB
実行使用メモリ 7,908 KB
最終ジャッジ日時 2023-09-01 23:09:29
合計ジャッジ時間 1,498 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,820 KB
testcase_01 AC 16 ms
7,768 KB
testcase_02 AC 16 ms
7,780 KB
testcase_03 AC 16 ms
7,860 KB
testcase_04 AC 16 ms
7,888 KB
testcase_05 AC 16 ms
7,784 KB
testcase_06 AC 15 ms
7,764 KB
testcase_07 AC 16 ms
7,848 KB
testcase_08 AC 16 ms
7,908 KB
testcase_09 AC 16 ms
7,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys


def next_str() -> str:
    result = ""
    while True:
        tmp = sys.stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


def next_int() -> int:
    return int(next_str())


def main() -> None:
    score = 0
    bonus = 1
    pf, gt, gd, ms = [next_int() for _ in range(4)]

    if ms >= 10:
        print("Impossible")
        return

    for i in range(1, sys.maxsize):
        if gt == 0 and pf == 0:
            break
        elif gt != 0:
            score += 50 * bonus
            gt -= 1
        elif pf != 0:
            score += 100 * bonus
            pf -= 1

        if i % 100 == 0:
            bonus *= 2

    print("Possible\n" + str(score))


if __name__ == '__main__':
    main()
0