結果
| 問題 | No.825 賢いお買い物 |
| コンテスト | |
| ユーザー |
Bwambocos
|
| 提出日時 | 2019-05-03 21:36:42 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 852µs | |
| コード長 | 517 bytes |
| 記録 | |
| コンパイル時間 | 1,020 ms |
| コンパイル使用メモリ | 183,852 KB |
| 実行使用メモリ | 9,868 KB |
| 最終ジャッジ日時 | 2026-10-13 10:53:44 |
| 合計ジャッジ時間 | 2,623 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
int main()
{
LL A, B, C;
in >> A >> B >> C;
for (LL i = 1; i <= A + 10 * B; ++i)
{
for (LL a = 0; a <= A; ++a)
{
for (LL b = 0; b <= B; ++b)
{
LL charge = (a + 10 * b) - i;
if (charge < 0) continue;
if (charge / 10 + charge % 10 + (A - a) + (B - b) == C)
{
out << i << std::endl;
return 0;
}
}
}
}
out << "Impossible" << std::endl;
}
Bwambocos