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 <bits/stdc++.h>
using namespace std;
vector<int> v1, v2;
void Ramen(int N) {
if(N == 1) Answer(0, 0);
for(int i=0; i+1<N; i+=2) {
if(Compare(i, i + 1) == 1) v1.push_back(i), v2.push_back(i + 1);
else v1.push_back(i + 1), v2.push_back(i);
}
if(N % 2 == 1) {
if(Compare(N - 1, 0) == 1) v1.push_back(N - 1);
else v2.push_back(N - 1);
}
int X = v1[0], Y = v2[0];
for(int i=1; i<(int)v1.size(); i++) if(Compare(v1[i], X) == +1) X = v1[i];
for(int i=1; i<(int)v2.size(); i++) if(Compare(v2[i], Y) == -1) Y = v2[i];
Answer(Y, X);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |