結果
問題 |
No.617 Nafmo、買い出しに行く
|
ユーザー |
![]() |
提出日時 | 2019-01-21 23:27:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 323 bytes |
コンパイル時間 | 1,490 ms |
コンパイル使用メモリ | 165,508 KB |
実行使用メモリ | 11,392 KB |
最終ジャッジ日時 | 2024-09-15 13:24:00 |
合計ジャッジ時間 | 3,793 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 2 |
other | AC * 17 RE * 3 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N,K,x; cin>>N>>K; int dp[2000200]={}; dp[0]=1; while(N--){ cin>>x; for(int j = 2000210-x; j >= 0; --j)if(dp[j]!=0)dp[j+x]=1; } for(int i = K ; i >= 0 ; i--)if(dp[i]){ cout<<i<<"\n"; return 0; } }