結果

問題 No.825 賢いお買い物
ユーザー gamer0819
提出日時 2019-06-10 22:45:31
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 543 ms
コンパイル使用メモリ 54,104 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 01:00:09
合計ジャッジ時間 1,240 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 17 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    int price = 0;
    int rest = a+b;
    if (rest-c <= 0) {
        cout << "Impossible" << endl;
        return 0;
    }
    while (rest>c) {
        if (rest>b) price += 1;
        else price += 10;
        rest--;
    }
    cout << price << endl;
    return 0;
}
0