제출 #344291

#제출 시각아이디문제언어결과실행 시간메모리
344291katearima은행 (IZhO14_bank)C++14
19 / 100
1 ms368 KiB
#include <bits/stdc++.h> using namespace std; const int N=25; const int M=1005; int n, m, a[N], b[N], dp[M] , mx; main(){ cin>>n>>m; for(int i=0; i<n; i++){ cin>>a[i]; mx=max(mx, a[i]); } //n=1; for(int i=0; i<m; i++){ cin>>b[i]; } dp[0]=1; for(int i=0; i<m; i++){ for(int j=mx; j>=0; j--){ if(j-b[i]<0) continue; dp[j]+=dp[j-b[i]]; } } for(int i=0; i<n; i++) if(dp[a[i]]>0) cout<<"YES"<<endl; else cout<<"NO"<<endl; }

컴파일 시 표준 에러 (stderr) 메시지

bank.cpp:6:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...