Submission #1001638

#TimeUsernameProblemLanguageResultExecution timeMemory
1001638ara_araBank (IZhO14_bank)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define int long long using namespace std; const int maxn=(1<<20); int n,m,a[21],b[21]; pair<int,int> dp[maxn]; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n>>m; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<m;i++) cin>>b[i]; for(int mask=0;mask<(1<<m);mask++){ if(dp[mask].first==n){ cout<<"YES"; return 0; } if(dp[mask]=={0,0} && mask!=0) continue; for(int i=0;i<m;i++){ if((mask>>i & 1)==0){ int nxt=mask^(1<<i); if(dp[mask].second+b[i]>a[dp[mask].first]) continue; dp[nxt].second=dp[mask].second+b[i]; dp[nxt].first=dp[mask].first; if(dp[nxt].second==a[dp[nxt].first]){ dp[nxt].first++; dp[nxt].second=0; } } } } cout<<"NO"; }

Compilation message (stderr)

bank.cpp: In function 'int main()':
bank.cpp:19:22: error: expected primary-expression before '{' token
   19 |         if(dp[mask]=={0,0} && mask!=0) continue;
      |                      ^
bank.cpp:19:22: error: expected ')' before '{' token
   19 |         if(dp[mask]=={0,0} && mask!=0) continue;
      |           ~          ^
      |                      )