Submission #99358

#TimeUsernameProblemLanguageResultExecution timeMemory
99358nad312Cave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include <cave.h> #include<bits/stdc++.h> using namespace std; const lli N=5009, inf=1e15; lli a[N], query[N], com[N], pos[N]; //tryCombination(intS[]) lli Ask() { lli k=tryCombination(query); if(k==-1) { return inf; } return k; } void Find(lli x) { vector<lli> p; for(int i=1;i<=n;i++) { if(com[i]==-1) { query[i]=0; p.push_back(i); } else { query[i]=com[i]; } } lli a=(Ask()>x), l=0, h=p.size()-1; while(l<h) { lli mid=(l+h)/2; for(int i=l;i<=mid;i++) { query[p[i]]=0; } for(int i=mid+1;i<=h;i++) { query[p[i+1]]=1; } if(Ask()>x) { if(a==1) { h=mid; } else { l=mid+1; } } else { if(a==1) { l=m+1; } else { h=mid; } } } com[l]=(a^1); pos[l]=i; } void exploreCave(int n) { fill_n(&com[0], sizeof(com)/sizeof(com[0]), -1); fill_n(&pos[0], sizeof(pos)/sizeof(pos[0]), -1); for(int i=1;i<=n;i++) { Find(i); } answer(com, pos); }

Compilation message (stderr)

cave.cpp:5:7: error: 'lli' does not name a type; did you mean 'lldiv'?
 const lli N=5009, inf=1e15;
       ^~~
       lldiv
cave.cpp:6:1: error: 'lli' does not name a type; did you mean 'lldiv'?
 lli a[N], query[N], com[N], pos[N];
 ^~~
 lldiv
cave.cpp:9:1: error: 'lli' does not name a type; did you mean 'lldiv'?
 lli Ask()
 ^~~
 lldiv
cave.cpp:18:11: error: variable or field 'Find' declared void
 void Find(lli x)
           ^~~
cave.cpp:18:11: error: 'lli' was not declared in this scope
cave.cpp:18:11: note: suggested alternative: 'lldiv'
 void Find(lli x)
           ^~~
           lldiv
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:73:10: error: 'com' was not declared in this scope
  fill_n(&com[0], sizeof(com)/sizeof(com[0]), -1);
          ^~~
cave.cpp:73:10: note: suggested alternative: 'cos'
  fill_n(&com[0], sizeof(com)/sizeof(com[0]), -1);
          ^~~
          cos
cave.cpp:74:10: error: 'pos' was not declared in this scope
  fill_n(&pos[0], sizeof(pos)/sizeof(pos[0]), -1);
          ^~~
cave.cpp:74:10: note: suggested alternative: 'pow'
  fill_n(&pos[0], sizeof(pos)/sizeof(pos[0]), -1);
          ^~~
          pow
cave.cpp:77:3: error: 'Find' was not declared in this scope
   Find(i);
   ^~~~
cave.cpp:77:3: note: suggested alternative: 'rand'
   Find(i);
   ^~~~
   rand