結果

問題 No.2386 Udon Coupon (Easy)
ユーザー twooimp
提出日時 2023-07-21 22:39:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 305 bytes
コンパイル時間 1,651 ms
コンパイル使用メモリ 167,228 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-09-22 00:08:57
合計ジャッジ時間 4,976 ms
ジャッジサーバーID
(参考情報)
judge1 / 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 i=0;i<=n/3;i++){
    for(ll j=0;3*i+5*j<=n;j++){
      for(ll k=0;3*i+5*j+10*k<=n;k++){
        ans=max(ans,a*i+b*j+c*k);
      }
    }
  }
  cout<<ans<<endl;
}
0