#include <bits/stdc++.h>
#include "rail.h"
using namespace std;
unordered_map<int,int> M;
void findLocation(int n, int first, int location[], int stype[]){
for(int i=1;i<n;i++){
int a=getDistance(0,i);
M[i]=a;
}
int min=100000;
int estacionsupergod;
for(auto x:M){
if(x.second<min){
min=x.second;
estacionsupergod=x.first;
}
}
location[estacionsupergod]=first+M[estacionsupergod];
for(int i=1;i<n;i++){
if(i!=estacionsupergod){
int b=getDistance(estacionsupergod,i);
if(M[i]-M[estacionsupergod]==b){
stype[i]=2;
location[i]=M[i]+first;
}else{
stype[i]=1;
location[i]=location[estacionsupergod]-b;
}
}
}
stype[0]=1;
stype[estacionsupergod]=2;
}
# | 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... |