#include <bits/stdc++.h>
#define pb push_back
//#define int long long
using namespace std;
/* This is sample grader for the contestant */
#include "rail.h"
const int inf = 1e9;
void findLocation(int N, int first, int location[], int stype[])
{
int dismin = inf, minb = 0;
for(int i = 1; i < N; i++){
int x = getDistance(0, i);
if(x < dismin){
dismin = x;
minb = i;
}
}
location[minb] = first + dismin;
stype[minb] = 2; // sagimdaki ilk D
for(int i = 1; i < N; i++){
if(i == minb) continue;
int x = getDistance(0, i);
int y = getDistance(minb, i);
if(x > y){
stype[i] = 1;
location[i] = location[minb] - y;
}
else{
stype[i] = 2;
location[i] = location[0] + x;
}
}
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... |