# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
781884 | ymm | 라멘 (JOI14_ramen) | C++17 | 1 ms | 288 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"
void Ramen(int N) {
int a[300], b[300];
for (int i = 0; i < N; i += 2) {
if (i+1 >= N) {
a[i/2] = b[i/2] = i;
} else if (Compare(i, i+1) < 0) {
a[i/2] = i;
b[i/2] = i+1;
} else {
a[i/2] = i+1;
b[i/2] = i;
}
}
int mx = b[0];
for (int i = 1; i < (N+1)/2; ++i) {
if (Compare(mx, b[i]) < 0)
mx = b[i];
}
int mn = a[0];
for (int i = 1; i < (N+1)/2; ++i) {
if (Compare(mn, a[i]) > 0)
mn = a[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... |