結果

問題 No.825 賢いお買い物
ユーザー ward1302
提出日時 2019-05-03 22:37:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 507 bytes
コンパイル時間 799 ms
コンパイル使用メモリ 76,684 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-31 18:17:09
合計ジャッジ時間 1,666 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <utility>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
using namespace std;

int main() {
	int A, B, C;
	cin >> A >> B >> C;
	if(A+B<=C) cout << "Impossible" << endl;
	else{
	    if(B>=C) cout << A+10*(B-C) << endl;
	    else{
	        int m, n;
	        m=n=A-(C-B);
	        while(m-9>0 && n+1<=A){
	            m -= 9;
	            ++n;
	        }
	        cout << m << endl;
	    }
	}
	return 0;
}
0