結果
問題 | No.2329 Nafmo、イカサマをする |
ユーザー |
👑 ![]() |
提出日時 | 2023-05-28 17:48:16 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 565 ms / 2,000 ms |
コード長 | 303 bytes |
コンパイル時間 | 2,023 ms |
コンパイル使用メモリ | 192,032 KB |
最終ジャッジ日時 | 2025-02-13 15:43:28 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll=long long; ll N,M,K,ans=0,A[100]; void f(ll v,ll c,ll d){ if(M<v) return; if(d==N||c==K) ans=max(ans,v); else for(ll i=0;i<=K-c;i++) f(v+i*A[d],c+i,d+1); } int main(){ cin>>N>>M>>K; for(ll i=0;i<N;i++) cin>>A[i]; f(0,0,0); cout<<ans<<"\n"; }