Submission #1129110

#TimeUsernameProblemLanguageResultExecution timeMemory
1129110liangjeremyBank (IZhO14_bank)C++20
19 / 100
50 ms328 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,m; cin>>n>>m; int num; cin>>num; vector<int>a(m); for(int i=0; i<m; i++){ cin>>a[i]; } bool ans=false; for(int i=0; i<(1<<m); i++){ int sum=0; for(int j=0; j<m; j++){ if(i&(1<<j)){ sum+=a[j]; } } if(sum==num)ans=true; } if(ans)cout<<"YES"; else cout<<"NO"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...