#include<bits/stdc++.h>
using namespace std;
#include "ramen.h"
void Ramen(int n){
if(n == 1) Answer(0, 0);
int Mx = 0, Mn = 1;
if(Compare(0, 1) < 0) swap(Mx, Mn);
for(int i = 2; i + 1 < n; i += 2){
int j1 = i, j2 = i + 1;
if(Compare(j1, j2) < 0) swap(j1, j2);
if(Compare(j1, Mx) > 0) Mx = j1;
if(Compare(j2, Mn) < 0) Mn = j2;
}
if((n&1)){
if(Compare(n - 1, Mx) > 0) Mx = n - 1;
if(Compare(n - 1, Mn) < 0) Mn = n - 1;
}
Answer(Mn, Mx);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |