結果
| 問題 |
No.825 賢いお買い物
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-05-10 17:19:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,109 bytes |
| コンパイル時間 | 1,609 ms |
| コンパイル使用メモリ | 166,448 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-02 01:00:50 |
| 合計ジャッジ時間 | 2,266 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 9 |
ソースコード
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define INF 1145141919
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
int ny, nx;
typedef long long int ll;
using namespace std;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll m, ll n)
{
if ((0 == m) || (0 == n))
return 0;
return ((m / gcd(m, n)) * n);
}
ll llpow(ll x, ll y)
{
ll ans = 1;
REP(i, y)
ans *= x;
return ans;
}
int ctoi(char c)
{
if (c >= '0' && c <= '9')
{
return c - '0';
}
return 0;
}
////////////////////////////////////////////////////////////////////
int main()
{
ll a,b,c; cin >> a >> b >> c;
ll ans=0;
if(a+b<=c){
cout << "Impossible" << endl;
return 0;
}else{
ll res = a+b-c;
if(a>=res) ans+=c;
else ans=a+(res-a)*10;
if(res>=11){
cout << res-9 << endl;
return 0;
}
}
cout << ans << endl;
return 0;
}