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>
#define fr first
#define sc second
#define mk make_pair
#define pb push_back
using namespace std;
const int N = (int)2e5 + 5;
int n;
int mn = 1e9,st;
void findLocation(int N, int first, int location[], int stype[])
{
n = N;
for (int i = 1; i < n; i ++) {
int o = getDistance(0,i);
if (mn > o) mn = o,st = i;
}
location[0] = first;
location[st] = first + mn;
stype[0] = 1;
stype[st] = 2;
for (int i = 1; i < n; i ++) {
if (location[i])
continue;
int a = getDistance(0,i);
int b = getDistance(st,i);
if (a > b) {
stype[i] = 1;
location[i] = location[st] - b;
}
else {
stype[i] = 2;
location[i] = first + a;
}
}
}
# | 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... |