結果
問題 | No.3065 Speedrun (Normal) |
ユーザー |
|
提出日時 | 2025-03-21 22:45:58 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 475 bytes |
コンパイル時間 | 2,055 ms |
コンパイル使用メモリ | 200,696 KB |
実行使用メモリ | 5,888 KB |
最終ジャッジ日時 | 2025-03-21 22:46:01 |
合計ジャッジ時間 | 2,659 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; #include<atcoder/modint> using namespace atcoder; using mint=modint998244353; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); vector<array<ll,2>> A(4); for(int i=0;i<4;i++)cin>>A[i][1]; for(int i=0;i<4;i++)cin>>A[i][0]; sort(A.begin(),A.end()); ll T; cin>>T; ll S=0; ll an=0; for(int i=0;i<4;i++){ ll D=min(A[i][1],(T-S)/A[i][0]); an+=D; S+=A[i][0]*D; } cout<<an<<endl; }