Submission #899416

#TimeUsernameProblemLanguageResultExecution timeMemory
899416nasir_bashirovBank (IZhO14_bank)C++11
19 / 100
10 ms440 KiB
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include <bits/stdc++.h> using namespace std; #define db long double #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vl vector<ll> #define vii vector<pii> #define vll vector<pll> #define endl '\n' #define all(x) x.begin(), x.end() #define fastio\ ios_base::sync_with_stdio(0);\ cin.tie(0);\ cout.tie(0)\ #define int long long int a[25], b[25], n, m; signed main(){ cin >> n >> m; for(int i = 1; i <= n; i++){ cin >> a[i]; } for(int i = 1; i <= m; i++){ cin >> b[i]; } for(int mask = 1; mask < (1 << m); mask++){ int s = 0; for(int j = 0; j < m; j++){ if((1 << j) & mask){ s += b[j + 1]; } } if(s == a[1]){ cout << "YES"; return 0; } } 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...