# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
159293 | TAISA_ | Rail (IOI14_rail) | C++14 | 83 ms | 500 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 "rail.h"
#include <bits/stdc++.h>
using namespace std;
void findLocation(int N, int first, int location[], int stype[]) {
location[0] = first;
stype[0] = 1;
int mi = 10000000, id;
for (int i = 1; i < N; i++) {
int d = getDistance(0, i);
if (mi > d) {
mi = d;
id = i;
}
}
location[id] = first + mi;
stype[id] = 2;
for (int i = 1; i < N; i++) {
if (i == id) {
continue;
}
int d1 = getDistance(0, i);
int d2 = getDistance(id, i);
if (d1 == d2 + mi) {
location[i] = location[id] - d2;
stype[i] = 1;
} else {
location[i] = location[0] + d1;
stype[i] = 2;
}
}
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |