結果
問題 | No.846 メダル |
ユーザー | sprng_wl |
提出日時 | 2019-07-05 21:53:14 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 344 bytes |
コンパイル時間 | 1,370 ms |
コンパイル使用メモリ | 158,816 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-06 21:30:44 |
合計ジャッジ時間 | 2,005 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> #define Int int64_t using namespace std; int main() { Int P, Q, R, A, B, C; cin >> P >> Q >> R >> A >> B >> C; Int l = max({P*(A - 1), Q*(A + B - 1), R*(A + B + C - 1)}); Int r = min({P*A, Q*(A + B), R*(A + B + C)}); if (l < r) { cout << l + 1 << " " << r << endl; } else { cout << -1 << endl; } return 0; }