結果

問題 No.846 メダル
ユーザー betrue12
提出日時 2019-07-05 21:37:57
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 1,515 ms
コンパイル使用メモリ 166,024 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 21:10:55
合計ジャッジ時間 2,422 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    int64_t P, Q, R, A, B, C;
    cin >> P >> Q >> R >> A >> B >> C;

    int64_t mx = min({A*P, (A+B)*Q, (A+B+C)*R});
    int64_t mn = max({(A-1)*P, (A+B-1)*Q, (A+B+C-1)*R}) + 1;
    if(mx >= mn){
        cout << mn << " " << mx << endl;
    }else{
        cout << -1 << endl;
    }
    
    return 0;
}
0