# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
789517 | NothingXD | 라멘 (JOI14_ramen) | C++17 | 1 ms | 304 KiB |
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;
void debug_out() {cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T){
cerr << H << ' ';
debug_out(T...);
}
#define debug(...) cerr << "(" << #__VA_ARGS__ << "): ", debug_out(__VA_ARGS__)
void Ramen(int N) {
vector<int> mns;
vector<int> mxs;
N--;
for (int i = 0; i < N; i += 2){
int tmp = Compare(i, i+1);
if (tmp == 1){
mns.push_back(i+1);
mxs.push_back(i);
}
else{
mns.push_back(i);
mxs.push_back(i+1);
}
}
N++;
if (N & 1){
mns.push_back(N-1);
mxs.push_back(N-1);
}
int mn = mns[0];
for (int i = 1; i < mns.size(); i++){
int tmp = Compare(mn, mns[i]);
if (tmp == 1) mn = mns[i];
}
int mx = mxs[0];
for (int i = 1; i < mxs.size(); i++){
int tmp = Compare(mx, mxs[i]);
if (tmp == -1) mx = mxs[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... |