結果
問題 |
No.3065 Speedrun (Normal)
|
ユーザー |
![]() |
提出日時 | 2025-03-24 23:14:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 558 bytes |
コンパイル時間 | 712 ms |
コンパイル使用メモリ | 79,504 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-24 23:14:43 |
合計ジャッジ時間 | 1,440 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { vector<pair<long long,long long>>problem(4); long long t; for(int i=0;i<4;i++)cin >> problem[i].second; for(int i=0;i<4;i++)cin >> problem[i].first; cin >> t; sort(problem.begin(),problem.end()); long long ans=0; for(int i=0;i<4;i++){ if(t/problem[i].first>=problem[i].second){ ans+=problem[i].second; t-=problem[i].first*problem[i].second; } else{ ans+=t/problem[i].first; break; } } cout << ans << endl; }