Submission #330695

#TimeUsernameProblemLanguageResultExecution timeMemory
330695hakanaiBank (IZhO14_bank)C++17
Compilation error
0 ms0 KiB
// https://oj.uz/problem/view/IZhO14_bank #include <bits/stdc++.h> using namespace std; const int N = 1010; vector<int> mp[N]; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; vector<int> a(n), b(m); for ( int i=0; i<n; i++ ) cin >> a[i]; for ( int i=0; i<m; i++ ) cin >> b[i]; for ( int s=1; s<1<<m; s++ ) { int res = 0; for ( int i=0; i<m; i++ ) { if ( s>>i&1 ) res += b[i]; } if ( res<N ) mp[res].push_back(s); } set<int> avail; int s = (1<<m) - 1; avail.insert(s); for ( int i=0; i<n; i++ ) { set<int> navail; for ( int t:mp[a[i]] ) { for ( int s:avail ) { if ( (t&s)==t&&(s^t)>0&&s.count(s^t) ) { navail.insert(s^t); } } } if ( navail.empty() ) { cout << "NO" << '\n'; return 0; } avail = navail; } cout << "YES" << '\n'; return 0; }

Compilation message (stderr)

bank.cpp: In function 'int main()':
bank.cpp:31:43: error: request for member 'count' in 's', which is of non-class type 'int'
   31 |                 if ( (t&s)==t&&(s^t)>0&&s.count(s^t) ) {
      |                                           ^~~~~