結果

問題 No.3065 Speedrun (Normal)
ユーザー れいん
提出日時 2025-04-17 20:12:39
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 554 bytes
コンパイル時間 3,501 ms
コンパイル使用メモリ 280,880 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-04-17 20:12:44
合計ジャッジ時間 4,514 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
    vector<pair<unsigned long long, unsigned long long>> P(4);
    for (int i = 0; i < 4; i++)
    {
        cin >> P[i].second;
    }
    for (int i = 0; i < 4; i++)
    {
        cin >> P[i].first;
    }
    sort(P.begin(), P.end());
    unsigned long long T;
    cin >> T;
    unsigned long long ans = 0;
    for (int i = 0; i < 4; i++)
    {
        unsigned long long count = min(P[i].second, T / P[i].first);
        T -= count * P[i].first;
        ans += count;
    }
    cout << ans;
}
0