제출 #1027627

#제출 시각아이디문제언어결과실행 시간메모리
1027627vjudge1은행 (IZhO14_bank)C++14
19 / 100
62 ms436 KiB
#include <bits/stdc++.h> using namespace std; int n,m; const int MAX=20; int plata[MAX],pari[MAX]; int main() { cin>>n>>m; for(int i=0; i<n; i++)cin>>plata[i]; for(int i=0; i<m; i++)cin>>pari[i]; for(int mask=0; mask<(1<<m); mask++) { int cnt=0; for(int i=0; i<m; i++) { if(mask&(1<<i))cnt+=pari[i]; if(cnt==plata[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...