結果
問題 | No.846 メダル |
ユーザー | yuruhiya |
提出日時 | 2019-07-07 14:26:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 423 bytes |
コンパイル時間 | 712 ms |
コンパイル使用メモリ | 75,920 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-07 00:53:00 |
合計ジャッジ時間 | 1,643 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; using LL = long long; int main() { LL p, q, r, a, b, c; cin >> p >> q >> r >> a >> b >> c; LL x = max({(a - 1) * p + 1, (a + b - 1) * q + 1, (a + b + c - 1) * r + 1}); LL y = min({a * p, (a + b) * q, (a + b + c) * r}); if (x > y) cout << -1 << endl; else cout << x << " " << y << endl; }