이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rail.h"
#include <bits/stdc++.h>
using namespace std;
int used[105];
void findLocation(int N, int first, int location[], int stype[]) {
int cur = 0, pos = first, ty = 1;
while(cur != -1) {
location[cur] = pos;
stype[cur] = ty;
used[cur] = 1;
int mn = 1000, id = -1;
for (int i = 0; i < N; i++) {
if (used[i] == 0) {
int x = getDistance(cur, i);
if (x < mn) {
mn = x;
id = i;
}
}
}
if (ty == 1) pos += mn;
else pos -= mn;
ty = 3 - ty;
cur = id;
}
}
| # | 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... |