#include "ramen.h"
int a[410],b[410],w1,w2;
void Ramen(int N) {
int i,s,p,q;
if(N==1) Answer(0,0);
for(i=0;i<N-1;i+=2)
{
s=Compare(i,i+1);
if(s==1) a[++w1]=i, b[++w2]=i+1;
else a[++w1]=i+1, b[++w2]=i;
}
if(N%2==1) a[++w1]=N-1, b[++w2]=N-1;
p=a[1];
for(i=2;i<=w1;i++)
{
s=Compare(p,a[i]);
if(s==-1) p=a[i];
}
q=b[1];
for(i=2;i<=w2;i++)
{
s=Compare(q,b[i]);
if(s==1) q=b[i];
}
Answer(q,p);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1128 KB |
Output is correct |
2 |
Correct |
0 ms |
1128 KB |
Output is correct |
3 |
Correct |
0 ms |
1128 KB |
Output is correct |
4 |
Correct |
0 ms |
1128 KB |
Output is correct |
5 |
Correct |
0 ms |
1128 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1128 KB |
Output is correct |
2 |
Correct |
0 ms |
1128 KB |
Output is correct |
3 |
Correct |
0 ms |
1128 KB |
Output is correct |
4 |
Correct |
0 ms |
1128 KB |
Output is correct |
5 |
Correct |
0 ms |
1128 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1128 KB |
Output is correct |
2 |
Correct |
0 ms |
1128 KB |
Output is correct |
3 |
Correct |
0 ms |
1128 KB |
Output is correct |
4 |
Correct |
0 ms |
1128 KB |
Output is correct |
5 |
Correct |
0 ms |
1128 KB |
Output is correct |