結果

問題 No.3065 Speedrun (Normal)
ユーザー GOTKAKO
提出日時 2025-03-21 21:23:59
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 477 bytes
コンパイル時間 1,856 ms
コンパイル使用メモリ 199,780 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-21 21:24:03
合計ジャッジ時間 2,489 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    vector<pair<long long,long long>> AB(4);
    for(auto &[a,b] : AB) cin >> b;
    for(auto &[a,b] : AB) cin >> a;
    sort(AB.begin(),AB.end());

    long long t; cin >> t;
    long long answer = 0;
    for(int i=0; i<4; i++){
        auto [a,b] = AB.at(i);
        answer += min(t/a,b);
        t -= min(t/a,b)*a;
    }    
    cout << answer << endl;
}
0