#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);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1940 KB |
Output is correct |
2 |
Correct |
0 ms |
1940 KB |
Output is correct |
3 |
Correct |
0 ms |
1940 KB |
Output is correct |
4 |
Correct |
0 ms |
1940 KB |
Output is correct |
5 |
Correct |
0 ms |
1940 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1940 KB |
Output is correct |
2 |
Correct |
0 ms |
1940 KB |
Output is correct |
3 |
Correct |
0 ms |
1940 KB |
Output is correct |
4 |
Correct |
0 ms |
1940 KB |
Output is correct |
5 |
Correct |
0 ms |
1940 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1940 KB |
Output is correct |
2 |
Correct |
0 ms |
1940 KB |
Output is correct |
3 |
Correct |
0 ms |
1940 KB |
Output is correct |
4 |
Correct |
0 ms |
1940 KB |
Output is correct |
5 |
Correct |
0 ms |
1940 KB |
Output is correct |