# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
62984 | sean617 | 라멘 (JOI14_ramen) | C++98 | 3 ms | 656 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 <vector>
using namespace std;
void Ramen(int N) {
int i, mxi, mni;
vector<int> mx, mn;
mx.clear(), mn.clear();
for (i = 0; i < N - 1; i += 2) {
if (Compare(i, i + 1) == 1) {
mx.push_back(i);
mn.push_back(i + 1);
} else {
mx.push_back(i + 1);
mn.push_back(i);
}
}
if (i == N - 1) mx.push_back(N - 1), mn.push_back(N - 1);
mni = mn[0], mxi = mx[0];
for (i = 1; i < mn.size(); i++) if (Compare(mni, mn[i]) == 1) mni = mn[i];
for (i = 1; i < mx.size(); i++) if (Compare(mxi, mx[i]) == -1) mxi = mx[i];
Answer(mni, mxi);
}
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... |