Submission #383502

#TimeUsernameProblemLanguageResultExecution timeMemory
383502nicholaskCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int N){ int s[N],d[N]; for (int i=0; i<N; i++){ s[i]=0; d[i]=-1; } vector <int> ret; for (int i=0; i<N; i++){ ret.push_back(tryCombination(s)); int l=0,r=n-1; while (l<r){ int mid=(l+r)/2; for (int j=s; j<mid; j++){ if (d[j]==-1) s[j]^=1; } int cnt=0; if (ret.back()==i) cnt++; ret.push_back(tryCombination(s)); if (ret.back()==i) cnt++; if (cnt==1) r=mid; else l=mid+1; } if (ret.back()==i) s[l]^=1; d[l]=i; } answer(s,d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:13:13: error: 'n' was not declared in this scope
   13 |   int l=0,r=n-1;
      |             ^
cave.cpp:16:15: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   16 |    for (int j=s; j<mid; j++){
      |               ^
      |               |
      |               int*