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"
bool check[410];
void Ramen(int N) {
int i;
int ansx,ansy;
if(N == 1){
Answer(0,0);
return;
}
for(i=0; i+1<N; i+=2){
if(Compare(i,i+1) == 1) check[i] = true;
else check[i+1] = true;
}
if(check[0]) ansy = 0;
else ansy = 1;
if(N%2 == 1) check[N-1] = true;
for(i=2; i<N; i++){
if(!check[i]) continue;
if(Compare(ansy,i) == -1) ansy = i;
}
if(N%2 == 1) check[N-1] = false;
if(!check[0]) ansx = 0;
else ansx = 1;
for(i=2; i<N; i++){
if(check[i]) continue;
if(Compare(ansx,i) == 1) ansx = i;
}
Answer(ansx,ansy);
}
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... |