結果
問題 | No.846 メダル |
ユーザー | kpinkcat |
提出日時 | 2023-08-22 14:39:54 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 453 bytes |
コンパイル時間 | 993 ms |
コンパイル使用メモリ | 106,448 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-17 13:47:10 |
合計ジャッジ時間 | 1,823 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
#include<iostream> #include<map> #include<vector> #include <algorithm> #include<math.h> #include <iomanip> #include<set> #include <numeric> using namespace std; int main() { long long p, q, r, a, b, c, nmax, nmin; cin >> p >> q >> r >> a >> b >> c; nmax = min({p*a, q*(a+b), r*(a+b+c)}); nmin = max({p*(a-1), q*(a+b-1), r*(a+b+c-1)})+1; cout << ((nmax >= nmin) ? to_string(nmin) + " " + to_string(nmax) : to_string(-1)) << endl; }