結果
| 問題 |
No.846 メダル
|
| コンテスト | |
| ユーザー |
betit0919
|
| 提出日時 | 2019-07-07 09:07:15 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 714 bytes |
| コンパイル時間 | 847 ms |
| コンパイル使用メモリ | 100,384 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-07 00:43:32 |
| 合計ジャッジ時間 | 1,592 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 22 |
ソースコード
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <map>
#include <numeric>
#include <random>
#include <queue>
#include <deque>
#include <tuple>
#include <iomanip>
using namespace std;
typedef long long ll;
const int INF = (1 << 30) - 1;
const ll INFLL= (1LL << 61) - 1;
const int MOD = 1000000007;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
ll P,Q,R,A,B,C;
cin>>P>>Q>>R>>A>>B>>C;
B=A+B;C=B+C;
ll ma,mi;
ma=min({A*P,B*Q,C*R});
mi=max({A*P-P,B*Q-Q,C*R-R});
if(mi+1>ma){
cout<<-1<<endl;
}else{
cout<<mi+1<<" "<<ma<<endl;
}
}
betit0919