Submission #1098111

#TimeUsernameProblemLanguageResultExecution timeMemory
1098111vjudge1Bank (IZhO14_bank)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(n); int k = 0; for(int i = 0; i < n; i++) { cin >> a[i]; k += a[i]; } vector<int> b(m); for(int i = 0; i < m; i++) { cin >> b[i]; } for(int j = 0; j < (1 << M); j++) { int sum = 0; for(int i = 0; i < m; i++) { if(j & (1 << i)) { sum += b[i]; } } if(sum == k) { cout << "YES"; return 0; } } cout << "NO"; }

Compilation message (stderr)

bank.cpp: In function 'int main()':
bank.cpp:19:30: error: 'M' was not declared in this scope
   19 |     for(int j = 0; j < (1 << M); j++)
      |                              ^