Submission #354331

#TimeUsernameProblemLanguageResultExecution timeMemory
354331David_MCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int c[5003],f[5003],a[5003],i,j,x,l,r,m; void A(int R){for(;R>=l;R--)c[R]^=!f[R];r=m;} int T(){return(tryCombination(c)+9999)%9999<=i;} void exploreCave(int N){ for(;i<N;i++){ if(T())A(N-1); l=0,r=N-1; while(l<r)m=l+r>>1,A(m),T()?A(m):l=m+1; a[l]=i,f[l]=1; }answer(c,a); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:11:19: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   11 |      while(l<r)m=l+r>>1,A(m),T()?A(m):l=m+1;
      |                  ~^~
cave.cpp:11:40: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void'
   11 |      while(l<r)m=l+r>>1,A(m),T()?A(m):l=m+1;
      |                                       ~^~~~