結果
問題 |
No.3065 Speedrun (Normal)
|
ユーザー |
![]() |
提出日時 | 2025-03-21 21:30:10 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 649 bytes |
コンパイル時間 | 3,407 ms |
コンパイル使用メモリ | 281,008 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-21 21:30:15 |
合計ジャッジ時間 | 4,163 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long #define INF 9e18; int main(){ cin.tie(0)->sync_with_stdio(0); cout.tie(0); vector<pair<ll,ll>>data(4); rep(i,4) cin>>data.at(i).second; rep(i,4) cin>>data.at(i).first; ll T; cin>>T; sort(data.begin(),data.end()); ll ans=0; rep(i,4){ if(data.at(i).first*data.at(i).second<=T){ T-=data.at(i).first*data.at(i).second; ans+=data.at(i).second; } else{ ans+=T/data.at(i).first; break; } } cout<<ans<<endl; }