Submission #232750

#TimeUsernameProblemLanguageResultExecution timeMemory
232750T0p_Cave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; #define pii pair<int,int> #define x first #define y second void exploreCave(int N) { int s[N], d[N]; pii door[N]; for(int i=0 ; i<N ; i++) { s[i] = d[i] = 0; door[i] = {0, 0}; } for(int i=0 ; i<N ; i++) { for(int j=0 ; j<N ; j++) s[j] = 0; for(int j=0 ; j<i ; j++) s[door[j].x] = door[j].y; int start = tryCombination(s); int bit; (start > i || start == -1) ? bit = 0 : bit = 1; int l = 0, r = N-1; while(l != r) { int mid = (l+r)>>1; for(int j=0 ; j<N ; j++) s[j] = bit^1; for(int j=l ; j<=mid ; j++) s[j] = bit; for(int j=0 ; j<i ; j++) s[door[j].x] = door[j].y; int ret = tryCombination(s); if(ret > i || ret == -1) r = mid; else l = mid+1; } door[i] = make_pair(l, bit); } for(int i=0 ; i<N ; i++) { s[door[i].x] = door[i].y; d[i] = door[i].x; } answer(s[], d[]); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:44:11: error: expected primary-expression before ']' token
  answer(s[], d[]);
           ^
cave.cpp:44:16: error: expected primary-expression before ']' token
  answer(s[], d[]);
                ^