이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ramen.h"
#include <algorithm>
using namespace std;
typedef pair <int,int> ppair;
pair <int,int> t1;
pair <int,int> t2;
ppair MinMax(int left, int right)
{
int i, mid, MIN, MAX;
if(left==right)
return make_pair(left,right);
else if(left+1==right)
{
if(Compare(left,right)==-1)
return make_pair(left,right);
else
return make_pair(right,left);
}
else
{
mid=(left+right)/2;
t1=MinMax(left,mid);
t2=MinMax(mid+1,right);
if(Compare(t1.first,t2.first)==-1)
MIN=t1.first;
else
MIN=t2.first;
if(Compare(t1.second,t2.second)==-1)
MAX=t2.second;
else
MAX=t1.second;
return make_pair(MIN,MAX);
}
}
void Ramen(int N)
{
t1=MinMax(0,N-1);
Answer(t1.first,t1.second);
}
컴파일 시 표준 에러 (stderr) 메시지
ramen.cpp: In function 'ppair MinMax(int, int)':
ramen.cpp:12:9: warning: unused variable 'i' [-Wunused-variable]
int i, mid, MIN, MAX;
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |