이 제출은 이전 버전의 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(int o=L;o<=R;o++)if(f[o]==0)c[o]^=1;}
int T(int I){e=tryCombination(c);return e<=I&&e!=1;}
void exploreCave(int N){
memset(f,0,sizeof(f));
memset(a,0,sizeof(a));
memset(c,0,sizeof(c));
for(i=0;i<N;i++){
if(T(i))A(0,N-1);
l=0,r=N-1;
while(l<r){
m=(l+r)/2;
A(l,m);
e=T(i);
A(l,m);
if(e) r=m;
else l=m+1;
}
a[l]=i,f[l]=1;
}answer(c,a);
}
컴파일 시 표준 에러 (stderr) 메시지
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:12:6: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
12 | if(T(i))A(0,N-1);
| ^~
cave.cpp:13:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
13 | l=0,r=N-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... |