제출 #17466

#제출 시각아이디문제언어결과실행 시간메모리
17466AZE_XeRoX은행 (IZhO14_bank)C++98
19 / 100
67 ms636 KiB
#include <iostream> #include <cmath> #include <algorithm> #include <iomanip> #define MAXN 100001 #define intt long long int using namespace std; intt x , y , a[MAXN] , b[MAXN] , ans = 0 ; int main() { cin >> x >> y ; for ( intt i = 0 ; i < x ; i ++ ) cin >> a[i] ; for ( intt i = 0 ; i < y ; i ++ ) cin >> b[i] ; for(intt i = 0; i < (1<<y); i++) { intt c = 0; for (intt j = 0; j < y; j++) if (i & (1<<j)) c += b[j]; if (c==a[0]) ans = 1; } if(ans == 1) cout << "YES"<<endl; else 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...