# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
38854 | 14kg | Rail (IOI14_rail) | C++11 | 125 ms | 836 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>
#define N 5001
#define INF 999999999
using namespace std;
int n, zd[N], zero;
int rd[N], rw, r_num, lw, l_num;
int L_len, R_len, S_len, S[N];
pair<int, int> L[N], R[N];
void findLocation(int _n, int _zero, int out1[], int out2[]) {
int temp = INF, len;
bool check;
n = _n, zero = _zero;
for (int i = 1; i < n; i++) {
zd[i] = getDistance(0, i);
if (temp > zd[i]) {
temp = zd[i], r_num = i;
rw = zero + temp;
}
}
temp = rw - zero, lw = zero;
for (int i = 1; i < n; i++)
if (i != r_num) {
rd[i] = getDistance(r_num, i);
if (temp > rd[i])
temp = rd[i], lw = rw - rd[i], l_num = i;
# | 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... |