結果
| 問題 | No.3065 Speedrun (Normal) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-21 21:31:05 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 453 bytes |
| 記録 | |
| コンパイル時間 | 1,988 ms |
| コンパイル使用メモリ | 342,432 KB |
| 実行使用メモリ | 9,184 KB |
| 最終ジャッジ日時 | 2026-07-07 14:19:49 |
| 合計ジャッジ時間 | 3,161 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}