이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 L,int R){for(;R>=L;R--)c[R]^=(!f[R]);}
int T(){e=tryCombination(c);return e<=i&&e!=1;}
void exploreCave(int N){
for(;i<N;i++){
l=0,r=N-1;
if(T())A(0,N-1);
while(l<r){m=l+r>>1;A(l,m);if(T()){r=m;A(l,m);}else{A(l,m);l=m+1;}}
a[l]=i,f[l]=1;
}answer(c,a);
}
컴파일 시 표준 에러 (stderr) 메시지
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:11:20: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
11 | while(l<r){m=l+r>>1;A(l,m);if(T()){r=m;A(l,m);}else{A(l,m);l=m+1;}}
| ~^~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |