結果

問題 No.3065 Speedrun (Normal)
ユーザー daiota
提出日時 2025-03-21 21:34:35
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 694 bytes
コンパイル時間 1,314 ms
コンパイル使用メモリ 162,256 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-21 21:34:40
合計ジャッジ時間 1,907 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i=0;i<ll(n);i++)










int main(void){
	cin.tie(nullptr);  ios_base::sync_with_stdio(false);
	ll i,j;





	ll A,B,C,D;
	cin >> A >> B >> C >> D;
	ll P,Q,R,S,T;
	cin >> P >> Q >> R >> S >> T;


	ll ans=0;
	if(T>=A*P){
		ans+=A;
		T-=A*P;
	}else{
		cout << T/P << endl;
		return 0;
	}

	if(T>=B*Q){
		ans+=B;
		T-=B*Q;
	}else{
		cout << ans+T/Q << endl;
		return 0;
	}

	if(T>=C*R){
		ans+=C;
		T-=C*R;
	}else{
		cout << ans+T/R << endl;
		return 0;
	}

	if(T>=D*S){
		ans+=D;
	}else{
		cout << ans+T/S << endl;
		return 0;
	}



	cout << ans << endl;









	return 0;
}
0