結果
| 問題 |
No.3065 Speedrun (Normal)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-21 21:31:05 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 453 bytes |
| コンパイル時間 | 3,370 ms |
| コンパイル使用メモリ | 281,196 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2025-03-21 21:31:10 |
| 合計ジャッジ時間 | 4,085 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
vector<pair<ll, ll>> P(4);
for(int i = 0; i < 4; i++) cin >> P[i].second;
for(int i = 0; i < 4; i++) cin >> P[i].first;
ll T;
cin >> T;
ll ans = 0;
sort(P.begin(), P.end());
for(int i = 0; i < 4; i++) {
auto [t, n] = P[i];
ll x = min(n, T/t);
T -= x * t;
ans += x;
}
cout << ans << endl;
}