結果
問題 | No.745 letinopia raoha |
ユーザー |
|
提出日時 | 2024-03-29 20:33:05 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 664 bytes |
コンパイル時間 | 3,200 ms |
コンパイル使用メモリ | 250,824 KB |
最終ジャッジ日時 | 2025-02-20 14:37:56 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; using ld = long double; int main() { int a, b, c, d; cin >> a >> b >> c >> d; if (d >= 10) { cout << "Impossible" << endl; return 0; } cout << "Possible" << endl; int ans = 0; int i = 0, r = 100; while (b > 0) { int x = min(100, b); ans += 50 * x * (1 << i); r = 100 - b; b -= x; i++; } if (i > 0) i--; int x = min(r, a); ans += 100 * x * (1 << i); a -= x; i++; while (a > 0) { x = min(100, a); ans += 100 * x * (1 << i); a -= x; i++; } cout << ans << endl; return 0; }