Submission #319046

#TimeUsernameProblemLanguageResultExecution timeMemory
319046Genius1506Cave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "cave.h"; using namespace std; const int mxN = 5002; int S[mxN],D[mxN],good[mxN]; void exploreCave(int N){ memset(good,-1,sizeof(good)); for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++) if(good[j]==-1) S[j]=0; int tmp = tryCombination(S); int cur = (tmp==-1||tmp>i)?0:1; int lb=0,rb=N-1,v=0; while(lb<=rb){ int mb = (lb+rb)/2; for(int j = 0; j < N; j++) if(good[j]==-1) S[j]=j<=mb?cur:1-cur; tmp=tryCombination(S); if(tmp==-1||tmp>i) v=mb,rb=mb-1; else lb=mb+1; } good[v]=cur; d[v]=i; } answer(good,D); }

Compilation message (stderr)

cave.cpp:2:18: warning: extra tokens at end of #include directive
    2 | #include "cave.h";
      |                  ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:30:5: error: 'd' was not declared in this scope
   30 |     d[v]=i;
      |     ^