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[])
{
int dist[N];
dist[0] = 0, location[0] = first, stype[0] = 1;
if(N == 1) return;
int mini = 2e6 + 10, id = 0;
for(int i = 1; i < N; i++){
dist[i] = getDistance(0, i);
if(dist[i] < mini) mini = dist[i], id = i;
}
location[id] = first + dist[id];
stype[id] = 2;
for(int i = 1; i < N; i++){
if(i == id) continue;
int d = getDistance(id, i);
if(d + mini == dist[i]) location[i] = location[id] - d, stype[i] = 1;
else location[i] = first + dist[i], stype[i] = 2;
}
return;
}
# | 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... |