이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rail.h"
#include <bits/stdc++.h>
using namespace std;
void findLocation(int n, int first, int ans[], int type[]) {
ans[0] = first;
vector<int> a(n), b(n);
type[0] = 1;
int mn = 1e9;
for (int i = 1; i < n; i++) {
a[i] = getDistance(0, i);
b[i] = getDistance(i, 0);
if (a[i] == b[i]) {
type[i] = 2;
ans[i] = first + a[i];
mn = min(mn, a[i]);
} else {
type[i] = 1;
}
}
for (int i = 1; i < n; i++) {
if (type[i] == 1) {
if (a[i] > b[i]) {
ans[i] = first - b[i];
} else {
ans[i] = first + a[i];
}
}
}
}
# | 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... |