Submission #17215

#TimeUsernameProblemLanguageResultExecution timeMemory
17215muratCave (IOI13_cave)C++98
Compilation error
0 ms0 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; const int NN = 5001; int S[NN], go[NN], col[NN], h[NN]; inline int find(int bas, int son, int ccc, int ind) { if(bas == son) return bas; int orta = bas + son >> 1; for(int j = bas; j <= orta; j++) if(h[j]) S[j] = col[j]; else S[j] = ccc; for(int j = orta + 1; j <= son; j++) if(h[j]) S[j] = col[j]; else S[j] = !ccc; if(tryCombination(S) != ind) return find(bas, orta, ccc, ind); return find(orta+1, son, ccc, ind); } void exporeCave(int N) { for(int i = 0; i < N; i++) { for(int j = 0; j < N; j++) if(h[j]) S[j] = col[j]; else S[j] = 0; int ccc = 0; if(tryCombination(S) == i) ccc = 1; int index = find(0, N - 1, ccc, i); h[index] = 1; go[index] = i; col[index] = ccc; } answer(col, go); }

Compilation message (stderr)

cave.cpp: In function 'int find(int, int, int, int)':
cave.cpp:12:20: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     int orta = bas + son >> 1;
                ~~~~^~~~~
/tmp/ccrYdWPl.o: In function `main':
grader.c:(.text.startup+0xc): undefined reference to `exploreCave'
collect2: error: ld returned 1 exit status