# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
246591 | faremy | Rail (IOI14_rail) | C++14 | 115 ms | 632 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 <algorithm>
#include <vector>
const int MAXN = 5e3;
int dist0[MAXN];
int distA[MAXN];
std::vector<int> left, right;
void findLocation(int N, int first, int location[], int stype[])
{
location[0] = first;
stype[0] = 1;
for (int iSta = 1; iSta < N; iSta++)
dist0[iSta] = getDistance(0, iSta);
int stationA = std::min_element(dist0 + 1, dist0 + N) - dist0;
location[stationA] = location[0] + dist0[stationA];
stype[stationA] = 2;
distA[0] = dist0[stationA];
for (int iSta = 1; iSta < N; iSta++)
if (iSta != stationA)
{
distA[iSta] = getDistance(stationA, iSta);
if (dist0[iSta] == dist0[stationA] + distA[iSta])
left.emplace_back(iSta);
else
# | 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... |