Submission #174648

#TimeUsernameProblemLanguageResultExecution timeMemory
174648mosiashvililukaXoractive (IZhO19_xoractive)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int a,b,c,d,e,i,j,kl,n,l,r,ll,rr; vector <int> pas,qw; vector <pair <int, int> > qu[109]; multiset <int> s[109][109]; multiset <int> zx,xc,zzx; pair <int, int> msh[109][109]; map <int, int> mp; vector <int> mk(int q, int w){ vector <int> mim; for(int h=q; h<=w; h++) mim.push_back(h); return mim; } multiset <int> geet(vector <int> q){ q=get_pairwise_xor(q); multiset <int> mim; for(int h=0; h<q.size(); h++) mim.insert(h); return mim; } void mkqu(int q, int w, int rr, pair <int, int> pp){ if(kl<rr) kl=rr; if(w-q+1!=n-1){ msh[q][w]=pp; } if(q==w) return; qu[rr].push_back(make_pair(q,(q+w)/2)); mkqu(q,(q+w)/2,rr+1,make_pair(q,w)); mkqu((q+w)/2+1,w,rr+1,make_pair(q,w)); } vector <int> guess(int nzxc){ n=nzxc; for(i=1; i<=n+1; i++) pas.push_back(0); if(n<=15){ for(i=1; i<=n; i++){ pas[i]=ask(i); } pas.erase(pas.begin()); return pas; } pas[1]=ask(1); mkqu(2,n,1,make_pair(0,0)); zx=geet(mk(1,n)); xc=geet(mk(2,n)); for(multiset <int>::iterator it=xc.begin(); it!=xc.end(); it++){ zx.erase(zx.lower_bound((*it))); } mp.clear(); for(multiset <int>::iterator it=zx.begin(); it!=zx.end(); it++){ if((*it)==0) continue; mp[(*it)]++; if(mp[(*it)]%2==1){ s[2][n].insert(((*it)^pas[1])); } } for(i=2; i<=kl; i++){ qw.clear(); for(j=0; j<qu[i].size(); j++){ l=qu[i][j].first;r=qu[i][j].second; for(int h=l; h<=r; h++) qw.push_back(h); } zzx=geet(get_pairwise_xor(qw)); for(j=0; j<qu[i].size(); j++){ l=qu[i][j].first;r=qu[i][j].second; ll=msh[l][r].first;rr=msh[l][r].second; zx.clear(); for(set <int>::iterator it=s[ll][rr].begin(); it!=s[ll][rr].end(); it++){ multiset <int>::iterator t; t=zzx.lower_bound((*it)); if(t==zzx.end()||(*t)!=(*it)){ s[r+1][rr].insert((*it)); }else{ zx.insert((*it)); } } s[l][r]=zx; if(l+1==r){ pas[l]=ask(l); zx.erase(zx.lower_bound(pas[l])); pas[r]=(*zx.begin()); } } } pas.erase(pas.begin()); return pas; }

Compilation message (stderr)

Xoractive.cpp: In function 'std::multiset<int> geet(std::vector<int>)':
Xoractive.cpp:16:4: error: 'get_pairwise_xor' was not declared in this scope
  q=get_pairwise_xor(q);
    ^~~~~~~~~~~~~~~~
Xoractive.cpp:18:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int h=0; h<q.size(); h++) mim.insert(h);
               ~^~~~~~~~~
Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:36:11: error: 'ask' was not declared in this scope
    pas[i]=ask(i);
           ^~~
Xoractive.cpp:41:9: error: 'ask' was not declared in this scope
  pas[1]=ask(1);
         ^~~
Xoractive.cpp:58:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(j=0; j<qu[i].size(); j++){
            ~^~~~~~~~~~~~~
Xoractive.cpp:62:12: error: 'get_pairwise_xor' was not declared in this scope
   zzx=geet(get_pairwise_xor(qw));
            ^~~~~~~~~~~~~~~~
Xoractive.cpp:63:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(j=0; j<qu[i].size(); j++){
            ~^~~~~~~~~~~~~