이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "popa.h"
#define maxN 1005
using namespace std;
int resi(int x,int y,int* l,int* d){
if(x>y) return -1;
if(x==y) return x;
int a,b;
a=x;
b=y;
while(a<=b){
if(query(x,y,a,a)){
l[a]=resi(x,a-1,l,d);
d[a]=resi(a+1,y,l,d);
return a;
}
if(query(x,y,b,b)){
l[b]=resi(x,b-1,l,d);
d[b]=resi(b+1,y,l,d);
return b;
}
a++;
b--;
}
}
int solve(int n, int* l, int* d){
for(int i=0;i<n;i++) l[i]=d[i]=-1;
return resi(0,n-1,l,d);
}
컴파일 시 표준 에러 (stderr) 메시지
popa.cpp: In function 'int resi(int, int, int*, int*)':
popa.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |