이 제출은 이전 버전의 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;
void A(int r){for(;r>=l;r--)c[r]^=!f[r];}
int T(){return tryCombination(c)+8192&8191<=i;}
void exploreCave(int N){
for(;i<N;i++){
l=0,r=N-1;
if(T())A(r);
while(l<r){
m=l+r>>1;A(m);
T()?r=m,A(m):A(m),l=m+1;
}
a[l]=i,f[a[i]]=1;
}answer(c,a);
}
컴파일 시 표준 에러 (stderr) 메시지
cave.cpp: In function 'int T()':
cave.cpp:6:33: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses]
6 | int T(){return tryCombination(c)+8192&8191<=i;}
| ~~~~~~~~~~~~~~~~~^~~~~
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:12:10: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
12 | m=l+r>>1;A(m);
| ~^~
# | 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... |