結果
問題 | No.846 メダル |
ユーザー |
|
提出日時 | 2020-04-13 14:59:42 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 318 bytes |
コンパイル時間 | 2,179 ms |
コンパイル使用メモリ | 191,336 KB |
最終ジャッジ日時 | 2025-01-09 18:01:02 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; using lint=long long; int main(){ lint p,q,r,a,b,c; cin>>p>>q>>r>>a>>b>>c; lint L=max({p*(a-1),q*(a+b-1),r*(a+b+c-1)}); lint R=min({p*a,q*(a+b),r*(a+b+c)}); if(L<R) printf("%lld %lld\n",L+1,R); else puts("-1"); return 0; }