結果

問題 No.745 letinopia raoha
ユーザー Apoi
提出日時 2018-12-14 04:27:03
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 1,694 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-25 04:55:39
合計ジャッジ時間 1,110 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

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