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 <queue>
using namespace std;
queue <int> Q;
void Ramen(int N)
{
int i, min1, max1, min2, max2, MIN, MAX;
for(i=0 ; i<N ; i++)
{
Q.push(i);
Q.push(i);
}
while(Q.size()>2)
{
min1=Q.front();
Q.pop();
max1=Q.front();
Q.pop();
min2=Q.front();
Q.pop();
max2=Q.front();
Q.pop();
if(min1==max1 && min2==max2)
{
if(Compare(min1,min2)==-1)
{
MIN=min1;
MAX=min2;
}
else
{
MIN=min2;
MAX=min1;
}
}
else
{
if(Compare(min1,min2)==-1)
MIN=min1;
else
MIN=min2;
if(Compare(max1,max2)==1)
MAX=max1;
else
MAX=max2;
}
Q.push(MIN);
Q.push(MAX);
}
MIN=Q.front();
Q.pop();
MAX=Q.front();
Q.pop();
Answer(MIN,MAX);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |