結果
問題 |
No.846 メダル
|
ユーザー |
![]() |
提出日時 | 2019-07-05 23:44:38 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 638 bytes |
コンパイル時間 | 1,289 ms |
コンパイル使用メモリ | 160,212 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-06 23:21:01 |
合計ジャッジ時間 | 1,918 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 12 WA * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; const long double PI = acos(-1); typedef long long ll; typedef pair<int64_t,int64_t> pll; int dx[]={1,-1,0,0,1,-1,1,-1}; int dy[]={0,0,1,-1,1,-1,-1,1}; #define rep(i,a,b) for (int64_t i = (a); i < (b); i++) #define REP(i,n) rep(i,0,n) #define ALL(a) begin(a),end(a) #define sz(s) (s).size() #define pb push_back #define mp make_pair #define fi first #define se second int main() { ll p,q,r,a,b,c; cin>>p>>q>>r; cin>>a>>b>>c; int s=max({p*(a-1)+1,q*(a+b-1)+1,r*(a+b+c-1)+1}); int l=min({p*a,q*(a+b),r*(a+b+c)}); if(l<s)cout<<-1<<endl; else cout<<s<<" "<<l<<endl; }