Submission #1080938

#TimeUsernameProblemLanguageResultExecution timeMemory
1080938DarkMatterRail (IOI14_rail)C++17
8 / 100
45 ms604 KiB
#include "rail.h" #include<bits/stdc++.h> using namespace std; void findLocation(int N, int first, int location[], int stype[]) { for (int i = 0; i < N; i++) location[i] = -1; location[0] = first, stype[0] = 1; int mn = 1e9 + 7, val = -1; for (int i = 1; i < N; i++) { int dis = getDistance(0, i); if (dis < mn) mn = dis, val = i; } int mx = 0; for (int i = 1; i < N; i++) { int dis1 = getDistance(0, i), dis2 = getDistance(val, i); if (dis1 < dis2 || val == i) { location[i] = dis1 + first, stype[i] = 2; mx = max(mx, dis1); } } for (int i = 0; i < N; i++) { if (location[i] != -1) continue; int dis = getDistance(0, i) - mx - 1; location[i] = first - dis, stype[i] = 1; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...