제출 #1107244

#제출 시각아이디문제언어결과실행 시간메모리
1107244vjudge1은행 (IZhO14_bank)C++17
46 / 100
58 ms508 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define nn "\n"; #define pb push_back #define all(v) (v).begin() , (v).end() const int N = 2e5+ 4; int n , T , q , m ; signed main(){ cin>> n >> m ; int a[n+1] , b[m] , ok =0 ; for(int i= 1 ; i <= n ;i++)cin>> a[i]; for(int i =0 ; i < m; i++)cin>> b[i]; for(int i =1 ; i<= n; i++){ for(int j = 0 ; j < (1 << m )- 1; j++){ int x =0 ; for(int u =0 ; u < m ; u++){ if((j >> u )&1){ x+=b[u]; } } if(x== a[i]){ ok++; break; } } } if(ok == n ){ 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...