이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include<popa.h>
using namespace std;
/*
int query(int a,int b,int c,int d)
{
}
*/
int solve(int l,int r,int* Left,int* Right)
{
if(l==r)
{
Left[l]=-1;
Right[l]=-1;
return l;
}
if(l>r)return -1;
vector<int> order={};
for(int i=l;l+i<=r-i;i++)
{
order.push_back(l+i);
order.push_back(r-i);
}
for(auto i:order)
if(query(l,r,i,i))
{
Left[i]=solve(l,i-1,Left,Right);
Right[i]=solve(i+1,r,Left,Right);
return i;
}
}
int solve(int N, int* Left, int* Right)
{
return solve(0,N-1,Left,Right);
}
컴파일 시 표준 에러 (stderr) 메시지
popa.cpp: In function 'int solve(int, int, int*, int*)':
popa.cpp:33: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... |