Submission #1118932

#TimeUsernameProblemLanguageResultExecution timeMemory
1118932kirakosyanBank (IZhO14_bank)C++17
Compilation error
0 ms0 KiB
#include<algorithm> #include<iostream> #include<vector> #include<string> #include<random> #include<cmath> #include<stack> #include<map> #include <iomanip> #include <queue> #include <set> using namespace std; using ll = long long; using ull = unsigned long long; ll mod = 1e9 + 7; ll pv(ll a, ll b) { if (b == 0)return 1; ll res = (pv(a, b / 2)); if (b % 2) { return (((res * res) % mod) * (a % mod)) % mod; } else { return (res * res) % mod; } } vector<ll>a,b; vector<vector<ll>>gp; ll f=0; void recursia(ll mask,ll i){ if(i==-1){ f = 1; return; } for(ll x:gp[a[i]]){ // cout<<x<<" "<<a[i]<<endl; if((x&mask)==x){ recursia((x^mask),i-1); } } } void solve() { ll n,m,sum=0; cin >> n >> m; a=vector<ll>(n+5); b=vector<ll>(m+5); for(ll i=0;i<n;i++)cin >> a[i]; for(ll i=0;i<m;i++){ cin >> b[i]; sum+=b[i]; } gp=vector<vector<ll>>((sum+5)); for(ll i=1;i<(1<<m);i++){ ll ap=0; for(ll j=0;j<m;j++){ if(i&(1ll<<j)){ ap+=b[j]; } } gp[ap].push_ back(i); } for(ll i=0;i<n;i++){ if(gp[a[i]].size()==0ll){ cout<<"NO"<<endl; return; } } recursia((1ll<<m)-1,n-1); if(f==1)cout<<"YES"<<endl; else cout<<"NO"<<endl; } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin.tie(nullptr); ll _ = 1; // cin >> _; while (_--) { solve(); } }

Compilation message (stderr)

bank.cpp: In function 'void solve()':
bank.cpp:59:16: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type' {aka 'class std::vector<long long int>'} has no member named 'push_'
   59 |         gp[ap].push_ back(i);
      |                ^~~~~