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"
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);
}
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... |