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 <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <bits/stdc++.h>
using namespace std;
void findLocation(int N, int f, int loc[], int st[]){
st[0] = 1;
loc[0] = f;
int md = 1e9, id = 0;
for(int i = 1; i < N; i ++){
int c = getDistance(0, i);
if(md > c){
md = c;
id = i;
}
}
for(int i = 1; i < N; i ++){
int c1 = getDistance(0, i);
int c2 = getDistance(id, i);
if(c1 > c2 && c2 != 0){
st[i] = 1;
loc[i] = f - c2 + md;
}
else{
st[i] = 2;
loc[i] = f + c1;
}
}
}
# | 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... |