제출 #354325

#제출 시각아이디문제언어결과실행 시간메모리
354325David_M동굴 (IOI13_cave)C++14
컴파일 에러
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,e; void A(int R){for(;R>=l;R--)c[R]^=!f[R];} int T(){return(tryCombination(c)+9999)%9999<=i;} void exploreCave(int N){ for(i=0;i<N;i++){ l=0;r=N-1; if(T())A(r); while(l<r){ m=l+r>>1; A(m); e=tryCombination(c); if(e!=-1&&e<=i)e=1; else e=0; e?A(m),r=m:A(m),l=m+1; } a[l]=i; f[l]=1; }answer(c,a); }

컴파일 시 표준 에러 (stderr) 메시지

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