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 d[400][2], k=1;
for (int i = 0; i < n; i++) d[i][0] = d[i][1] = i;
while (k < n) {
for (int i = 0; i + k < n; i += k * 2) {
d[i][0] = Compare(d[i][0], d[i + k][0]) > 0 ? d[i][0] : d[i + k][0];
if (k > 1) d[i][1] = Compare(d[i][1], d[i + k][1]) < 0 ? d[i][1] : d[i + k][1];
else d[i][1] = (i * 2 + k) - d[i][0];
} k *= 2;
} Answer(d[0][1], d[0][0]);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |