結果

問題 No.745 letinopia raoha
ユーザー U-ArU-Ar
提出日時 2018-11-23 15:18:11
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 595 bytes
コンパイル時間 674 ms
コンパイル使用メモリ 51,704 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-26 04:13:13
合計ジャッジ時間 1,068 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

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 0;
    }
    
    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