結果
問題 |
No.2386 Udon Coupon (Easy)
|
ユーザー |
|
提出日時 | 2023-07-21 22:24:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 440 bytes |
コンパイル時間 | 1,494 ms |
コンパイル使用メモリ | 165,652 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-21 23:54:18 |
合計ジャッジ時間 | 2,820 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 WA * 3 |
ソースコード
#include <bits/stdc++.h> #define int long long int n, a, b, c, ans, tmp; signed main(){ scanf("%lld", &n); scanf("%lld%lld%lld", &a, &b, &c); ans = n / 30 * std::max(10 * a, std::max(6 * b, 3 * c)); n = n % 30; for(int i = 0;3 * i <= n;i++){ for(int j = 0;3 * i + 5 * j <= n;j++){ for(int k = 0;3 * i + 5 * j + 10 * k <= n;k++){ tmp = std::max(tmp, i * a + j * b + k * c); } } } printf("%lld", ans + tmp); return 0; }