# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
139102 | ibrahim001 | Rail (IOI14_rail) | C++14 | 84 ms | 500 KiB |
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 intt long long
#define pb push_back
#define F first
#define S second
#define endl '\n'
using namespace std;
const int inf = 1e9;
void findLocation(int N, int first, int location[], int stype[])
{
int n = N;
location[0]=first;
stype[0]=1;
if ( N == 1 )
return;
int best,minn=inf;
for ( int i = 1; i < n; i++ )
{
int k = getDistance(0,i);
if ( k < minn )
{
minn = k;
best = i;
}
}
stype[best] = 2;
location[best] = first+minn;
for ( int i = 1; i < n; i++ )
{
if ( i == best )
continue;
int k1=getDistance(0,i),k2=getDistance(best,i);
if ( k1 < k2 )
{
stype[i] = 2;
location[i] = first+k1;
}
else
{
stype[i] = 1;
location[i] = location[best]-k2;
}
}
}
Compilation message (stderr)
# | 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... |