結果

問題 No.745 letinopia raoha
ユーザー U-ArU-Ar
提出日時 2018-11-23 15:17:36
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 595 bytes
コンパイル時間 993 ms
コンパイル使用メモリ 53,840 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-06 23:19:31
合計ジャッジ時間 1,041 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
using namespace std;


int main() {
    int a,b,c,d;
    cin >> a; cin >> b; cin >> c; cin >> d; 
    if (d >= 10){
        cout << "Impossible\n";
        return 1;
    }
    
    cout << "Possible\n";
    
    int f = 1;
    long score = 0;

    while (b >= 100){
        score += 100 * 50 * f;
        b -= 100;
        f *= 2;
    }
    score += b * 50 * f;
    score += (100 - b) * 100 * f;
    a -= (100 - b);
    f *= 2;
    while (a >= 100){
        score += 100 * 100 * f;
        a-= 100;
        f *= 2;
    }
    score += a * 100 * f;

    cout << score << "\n";
}
0