Submission #974780

#TimeUsernameProblemLanguageResultExecution timeMemory
974780KasymKBank (IZhO14_bank)C++17
19 / 100
64 ms428 KiB
#include "bits/stdc++.h" using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n, m; cin >> n >> m; vector<int> a(n), b(m); for(int &i : a) cin >> i; for(int &i : b) cin >> i; for(int mk = 0; mk <= (1 << m); ++mk){ int sum = 0; for(int i = 0; i < m; ++i) if(mk >> i & 1) sum += b[m - i - 1]; if(sum == a[0]){ cout << "YES" << "\n"; return 0; } } cout << "NO" << "\n"; 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...