結果

問題 No.2386 Udon Coupon (Easy)
ユーザー twooimp
提出日時 2023-07-21 22:42:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 307 bytes
コンパイル時間 1,520 ms
コンパイル使用メモリ 165,840 KB
実行使用メモリ 8,448 KB
最終ジャッジ日時 2024-09-22 00:13:52
合計ジャッジ時間 5,036 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 TLE * 1 -- * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;

int main(){
  ll n;
  cin>>n;
  ll a,b,c;
  cin>>a>>b>>c;
  ll ans=0;
  for(ll z=0;z<=n/10;z++){
    for(ll y=0;5*y+10*z<=n;y++){
      for(ll x=0;3*x+5*y+10*z<=n;x++){
        ans=max(ans,a*x+b*y+c*z);
      }
    }
  }
  cout<<ans<<endl;
}
0