結果

問題 No.745 letinopia raoha
ユーザー CleyLCleyL
提出日時 2020-01-24 02:28:26
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 594 bytes
コンパイル時間 478 ms
コンパイル使用メモリ 63,320 KB
実行使用メモリ 4,476 KB
最終ジャッジ日時 2023-10-11 07:22:37
合計ジャッジ時間 1,853 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
    int a,b,c,d;cin>>a>>b>>c>>d;b*=100;a*=100;
    if(d == 10){
        cout << "Impossible" << endl;
        return 0;
    }
    int nw = 1;
    int ans = 0;
    while(a+b > 0){
        if(a+b < 100){
            ans += nw*(a+b);
            break;
        }else if(b >= 100){
            ans += nw*b;
            b-=100;
        }else if(a >= 100){
            ans += nw*a;
            a-=100;
        }else{
            ans += nw*b+nw*(100-b);
            a-=b;
            b=0;
        }
        nw *= 2;
    }
    cout << ans << endl;
}
0