結果
問題 | No.2386 Udon Coupon (Easy) |
ユーザー |
![]() |
提出日時 | 2023-07-27 19:25:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 46 ms / 2,000 ms |
コード長 | 425 bytes |
コンパイル時間 | 1,712 ms |
コンパイル使用メモリ | 193,184 KB |
最終ジャッジ日時 | 2025-02-15 19:36:36 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 37 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {ios::sync_with_stdio(false);cin.tie(nullptr);int N;cin >> N;int A,B,C;cin >> A >> B >> C;int ans = 0;for(int i = 0; i*3 <= N; i++) {if(B*2 < C) {ans = max(ans,A*i+(N-i*3)/10*C+(N-i*3)%10/5*B);}else {ans = max(ans,A*i+(N-i*3)/5*B);}}cout << ans << "\n";}