結果

問題 No.745 letinopia raoha
ユーザー ApoiApoi
提出日時 2018-12-14 04:27:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 1,694 bytes
コンパイル時間 699 ms
コンパイル使用メモリ 12,004 KB
実行使用メモリ 10,124 KB
最終ジャッジ日時 2023-10-25 09:51:55
合計ジャッジ時間 1,101 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
10,124 KB
testcase_01 AC 30 ms
10,124 KB
testcase_02 AC 30 ms
10,124 KB
testcase_03 AC 30 ms
10,124 KB
testcase_04 AC 30 ms
10,124 KB
testcase_05 AC 30 ms
10,124 KB
testcase_06 AC 29 ms
10,124 KB
testcase_07 AC 30 ms
10,124 KB
testcase_08 AC 30 ms
10,124 KB
testcase_09 AC 30 ms
10,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
perfect, great, good, miss = map(int, input().split())
combo = perfect + great


def clear():
    # クリア時のコンボ数は100コンボ単位で考慮する
    # 単価の低いgreatがスコア倍率の低いときにカウントされるようにする
    # それぞれの場合においてgreatが残りなにか、perfectが残り何かを確認
    # リストaは、スコア処理のために入力値を変化させるものとして用意
    a = [perfect, great, good, miss]
    score = 0
    if combo < 101:
        score = a[0] * 100 + a[1] * 50
    else:
        for i in range(combo // 100 + 1 if combo % 100 != 0 else combo // 100):
            if a[1] >= 100:
                score += 50 * 100 * (2 ** i)
                a[1] -= 100
            elif a[1] >= 1:
                score += 50 * a[1] * (2 ** i)
                last_great = a[1]
                a[1] -= a[1]
                # この時点でgreatはすべて使ったため、a[1]は0
                # 残りの計算にa[1]が必要なため、別途last_greatに格納
                if a[0] >= 100 - last_great:
                    score += 100 * (100 - last_great) * (2 ** i)
                    a[0] -= (100 - last_great)
                elif a[0] >= 1:
                    score += 100 * a[0] * (2 ** i)
                    a[0] -= a[0]
            else:
                if a[0] >= 100:
                    score += 100 * 100 * (2 ** i)
                    a[0] -= 100
                elif a[0] >= 1:
                    score += 100 * a[0] * (2 ** i)
                    a[0] -= a[0]
    print('Possible')
    print(score)


if miss < 10:
    clear()
else:
    print('Impossible')
0