Submission #50252

#TimeUsernameProblemLanguageResultExecution timeMemory
50252mirbek01철로 (IOI14_rail)C++17
30 / 100
85 ms764 KiB
#include "rail.h" #include <bits/stdc++.h> using namespace std; void findLocation(int N, int first, int location[], int stype[]){ location[0] = first; stype[0] = 1; if(N <= 1) return ; int mn = 1e9, id = 1; for(int i = 1; i < N; i ++){ int x = getDistance(0, i); if(mn > x){ mn = x; id = i; } } stype[id] = 2; location[id] = first + mn; for(int i = 1; i < N; i ++){ if(id == i) continue; int x = getDistance(id, i); int y = getDistance(0, i); if(x + mn == y){ stype[i] = 1; location[i] = location[id] - x; } if(x - mn == y){ stype[i] = 2; location[i] = first + y; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...