結果

問題 No.846 メダル
ユーザー chocorusk
提出日時 2019-07-05 19:41:04
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 708 bytes
コンパイル時間 754 ms
コンパイル使用メモリ 97,620 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 21:03:56
合計ジャッジ時間 1,515 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 12 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
    ll p, q, r, a, b, c;
    cin>>p>>q>>r;
    cin>>a>>b>>c;
    b+=a; c+=b;
    ll mn=max({(a-1)*p+1, (b-1)*q+1, (c-1)*r+1});
    ll mx=min({a*p, b*q, c*r});
    if(mn>mx) cout<<-1<<" "<<-1<<endl;
    else cout<<mn<<" "<<mx<<endl;
    return 0;
}
0