結果
| 問題 |
No.846 メダル
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-10 16:44:41 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 609 bytes |
| コンパイル時間 | 838 ms |
| コンパイル使用メモリ | 71,788 KB |
| 最終ジャッジ日時 | 2025-01-09 15:41:01 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 22 |
ソースコード
#include <iostream>
#include <vector>
using lint = long long;
void solve() {
std::vector<lint> ps(3);
for (auto& p : ps) std::cin >> p;
lint l = 0, r = 1LL << 60;
lint s = 0;
for (int i = 0; i < 3; ++i) {
lint x;
std::cin >> x;
s += x;
l = std::max(l, ps[i] * (s - 1));
r = std::min(r, ps[i] * s);
}
if (r <= l) {
std::cout << -1 << std::endl;
} else {
std::cout << l + 1 << " " << r << std::endl;
}
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}