# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
51133 | mirbek01 | Rail (IOI14_rail) | C++17 | 134 ms | 41792 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;
const int N = 5e3 + 2;
int n, dist[N][N], cur;
bool cmp(int a, int b){
return dist[cur][a] < dist[cur][b];
}
void findLocation(int N, int first, int location[], int stype[]){
location[0] = first;
stype[0] = 1;
if(N == 1) return ;
vector <int> l, r, v;
n = N;
int in = 1;
for(int i = 1; i < n; i ++){
dist[0][i] = dist[i][0] = getDistance(0, i);
if(dist[0][i] < dist[0][in]) in = i;
}
location[in] = first + dist[0][in];
stype[in] = 2;
for(int i = 1; i < n; i ++){
if(in == i) continue;
dist[in][i] = dist[i][in] = getDistance(in, 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... |