結果
| 問題 |
No.846 メダル
|
| コンテスト | |
| ユーザー |
kpinkcat
|
| 提出日時 | 2023-08-22 14:39:54 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 453 bytes |
| コンパイル時間 | 1,004 ms |
| コンパイル使用メモリ | 103,716 KB |
| 最終ジャッジ日時 | 2025-02-16 12:15:51 |
|
ジャッジサーバー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;
}
kpinkcat