This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "ramen.h"
#include <algorithm>
using namespace std;
typedef pair <int,int> ppair;
ppair MinMax(int left, int right)
{
pair <int,int> t1;
pair <int,int> t2;
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)
{
pair <int,int> temp;
temp=MinMax(0,N-1);
Answer(temp.first,temp.second);
}
Compilation message (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... |