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 big[201],small[201],mx,mn;
void Ramen(int N) {
if(N==1){
Answer(0,0);
return;
}
for(int i=0;i<N/2;i++){
if(Compare(2*i,2*i+1)==1){
big[i]=2*i;
small[i]=2*i+1;
}
else{
big[i]=2*i+1;
small[i]=2*i;
}
}
if(N%2)big[N/2]=small[N/2]=N-1;
mx=big[0];
mn=small[0];
for(int i=1;i<N/2+N%2;i++){
if(Compare(big[i],mx)==1)mx=big[i];
}
for(int i=1;i<N/2+N%2;i++){
if(Compare(small[i],mn)==-1)mn=small[i];
}
Answer(mn,mx);
}
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... |