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 <cstdio>
int max_arr[500],min_arr[500],max1,min1;
int n;
void Ramen(int N) {
int i;
for(i=0;i<N-1;i+=2){
if(Compare(i,i+1)==1) max_arr[i/2]=i,min_arr[i/2]=i+1;
else max_arr[i/2]=i+1,min_arr[i/2]=i;
}
n=N/2;
max1=max_arr[0]; min1=min_arr[0];
for(i=1;i<n;i++){
if(Compare(max1,max_arr[i])==-1) max1=max_arr[i];
if(Compare(min1,min_arr[i])==1) min1=min_arr[i];
}
if(N%2==1){
if(Compare(max1,N-1)==-1) max1=N-1;
if(Compare(min1,N-1)==1) min1=N-1;
}
printf("%d %d\n",min1,max1);
Answer(min1,max1);
}
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... |