結果
| 問題 | No.2386 Udon Coupon (Easy) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-21 21:46:45 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 2 ms / 2,000 ms |
| + 87µs | |
| コード長 | 465 bytes |
| 記録 | |
| コンパイル時間 | 878 ms |
| コンパイル使用メモリ | 184,796 KB |
| 実行使用メモリ | 9,796 KB |
| 最終ジャッジ日時 | 2026-09-02 00:15:38 |
| 合計ジャッジ時間 | 2,739 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
std::vector<int> b(3);
std::vector<int> f(n + 1);
for(int i = 0;i < 3;i ++)cin >> b[i];
std::vector<int> a = {3,5,10};
for(int i = 0;i < 3;i ++){
for(int j = a[i];j <= n;j ++){
f[j] = max(f[j - a[i]] + b[i],f[j]);
}
}
cout << f[n] << "\n";
return 0;
}