# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
139042 | toonewbie | Rail (IOI14_rail) | C++17 | 542 ms | 98580 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rail.h"
#include <bits/stdc++.h>
using namespace std;
int dist[5005][5005];
void findLocation(int n, int first, int location[], int stype[]) {
location[0] = first;
stype[0] = 1;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
dist[i][j] = dist[j][i] = getDistance(i, j);
}
}
int mn = 1e9, two;
for (int i = 1; i < n; ++i) {
if (dist[i][0] < mn) {
mn = dist[i][0];
two = i;
}
}
location[two] = first + mn;
stype[two] = 2;
for (int j = 1; j < n; ++j) {
if (j == two) continue;
if (dist[0][j] == dist[two][j]) {
location[j] = first + dist[0][j];
stype[j] = 1;
} else if (dist[0][j] < dist[two][j]) {
location[j] = first + dist[0][j];
if (dist[0][j] == dist[j][0]) stype[j] = 2;
else stype[j] = 1;
} else if (dist[two][j] < dist[0][j]) {
location[j] = location[two] - dist[two][j];
if (dist[two][j] + dist[two][0] == dist[j][0]) stype[j] = 1;
else stype[j] = 2;
}
}
}
컴파일 시 표준 에러 (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... |