Submission #1123156

#TimeUsernameProblemLanguageResultExecution timeMemory
1123156SalihSahinRail (IOI14_rail)C++20
30 / 100
60 ms584 KiB
#include <bits/stdc++.h> #define pb push_back //#define int long long using namespace std; #include "rail.h" const int inf = 1e9; void findLocation(int N, int first, int location[], int stype[]) { int dismin = inf, minb = 0; for(int i = 1; i < N; i++){ int x = getDistance(0, i); if(x < dismin){ dismin = x; minb = i; } } location[0] = first; stype[0] = 1; // init 0 location[minb] = first + dismin; stype[minb] = 2; // sagimdaki ilk D for(int i = 1; i < N; i++){ if(i == minb) continue; int x = getDistance(0, i); int y = getDistance(minb, i); if(x > y){ stype[i] = 1; location[i] = location[minb] - y; } else{ stype[i] = 2; location[i] = location[0] + x; } } return; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...