結果
| 問題 |
No.846 メダル
|
| コンテスト | |
| ユーザー |
zunda1st
|
| 提出日時 | 2019-03-27 10:57:46 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 760 bytes |
| コンパイル時間 | 644 ms |
| コンパイル使用メモリ | 81,196 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-06 20:52:46 |
| 合計ジャッジ時間 | 1,417 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 22 |
ソースコード
#include<map>
#include<iostream>
#include<deque>
#include<algorithm>
#include<string>
#include<cctype>
#include<iomanip>
#include<vector>
#include<queue>
#include<tuple>
#include<stdio.h>
using namespace std;
#define REP(i,b,e) for(ll i=(ll)b;i<(ll)e;i++)
#define rep0(i,n) REP(i,0ll,n)
#define rep1(i,n) REP(i,1ll,n+1)
#define shosu setprecision(10)
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> Q;
typedef pair<Q,ll> R;
ll longinf=1ll<<60;
int inf=1<<29;
//mleしなければぜんぶllでかく。
int main(){
ll p,q,r,a,b,c;
cin>>p>>q>>r>>a>>b>>c;
c=a+b+c;
b=a+b;
ll minN=max({p*(a-1),q*(b-1),r*(c-1)})+1;
ll maxN=min({p*a,q*b,r*c});
if(minN<=maxN){
cout<<minN<<" "<<maxN<<endl;
}
else{
cout<<-1<<endl;
}
return 0;
}
zunda1st