Submission #725862

#TimeUsernameProblemLanguageResultExecution timeMemory
725862AndrijaMBank (IZhO14_bank)C++14
19 / 100
63 ms304 KiB
#include <bits/stdc++.h> using namespace std; int n,m; int x[23]; int y[23]; int main() { cin>>n>>m; for(int i=0;i<n;i++)cin>>x[i]; for(int i=0;i<m;i++)cin>>y[i]; for(int i=0;i<(1<<m);i++) { int sum=0; for(int bit=0;bit<=23;bit++) { if(i&(1<<bit)) { sum+=y[bit]; } } if(sum==x[0]) { cout<<"YES"<<endl; return 0; } } cout<<"NO"<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...