結果
| 問題 |
No.846 メダル
|
| コンテスト | |
| ユーザー |
cureskol
|
| 提出日時 | 2020-04-18 02:35:36 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 779 bytes |
| コンパイル時間 | 1,400 ms |
| コンパイル使用メモリ | 168,496 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-03 22:16:18 |
| 合計ジャッジ時間 | 2,255 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 22 |
ソースコード
//FA専用
#include <bits/stdc++.h>
using namespace std;
#define int long long
const long long LINF=1e18;
template<typename T>
void chmax(T &a,T b){
if(a<b)a=b;
}
template<typename T>
void chmin(T &a,T b){
if(a>b)a=b;
}
template<typename T>
void fin(T a){
cout<<a<<endl;
exit(0);
}
bool prime(int a){
for(int i=2;i*i<=a;i++)if(a%i==0)return false;
return 1;
}
bool hei(int a){
for(int i=2;i*i<=a;i++)if(i*i==a)return 1;
return 0;
}
bool rippo(int a){
for(int i=2;i*i<=a;i++)if(i*i*i==a)return 1;
return 0;
}
bool kanzen(int a){
return a==6||a==28;
}
signed main(){
int p,q,r,a,b,c;cin>>p>>q>>r>>a>>b>>c;b+=a;c+=b;
int m=min({p*a,q*b,r*c});
int ma=max({p*a+p-1,q*b+q-1,r*c+r-1});
if(m>ma)fin(-1);
cout<<m<<" "<<ma<<endl;
}
cureskol