結果
問題 |
No.2386 Udon Coupon (Easy)
|
ユーザー |
![]() |
提出日時 | 2023-07-21 21:40:14 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 737 bytes |
コンパイル時間 | 3,316 ms |
コンパイル使用メモリ | 160,344 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-21 23:04:24 |
合計ジャッジ時間 | 3,846 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 WA * 3 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long ull; typedef long double ld; int dx[8]={1,0,-1,0,1,1,-1,-1},dy[8]={0,1,0,-1,1,-1,1,-1}; const long long mod = 998244353; const ll inf = 1LL<<60; const int INF = 1e9+1; int main(){ int n;cin >> n; int a,b,c;cin >> a >> b >> c; int x = max({10*a,6*b,3*c}); int ans = 0; ans += n/30*x; n %= 30; int plus = 0; for(int i=0;i<10;i++){ for(int j=0;j<6;j++){ for(int k=0;k<3;k++){ int sum = 0; if(3*i+5*j+10*k>n)continue; sum = i*a+j*b+k*c; plus = max(plus,sum); } } } cout << ans + plus << endl; }