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[])
{
stype[0] = 1;
location[0] = first;
int second = -1;
int mn = 1e9;
for(int i = 1;i<n;i++){
if(getDistance(0,i) < mn){
mn = getDistance(0,i);
second = i;
}
}
stype[second] = 2;
location[second] = location[0]+mn;
for(int i = 1;i<n;i++){
if(i == second) continue;
if(getDistance(0,i) < getDistance(second,i)){
stype[i] = 2;
location[i] = location[0] + getDistance(0,i);
}else{
stype[i] = 1;
location[i] = location[second] - getDistance(second,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... |