Submission #246591

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2465912020-07-09 16:40:34faremyRail (IOI14_rail)C++14
100 / 100
115 ms632 KiB
#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
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...