| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 153929 | popovicirobert | 철로 (IOI14_rail) | C++14 | 92 ms | 1280 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rail.h"
#include <bits/stdc++.h>
using namespace std;
static map <pair <int, int>, int> qry;
inline int query(int a, int b) {
if(a > b) swap(a, b);
if(qry[{a, b}]) {
return qry[{a, b}];
}
return qry[{a, b}] = getDistance(a, b);
}
void findLocation(int n, int first, int location[], int stype[]) {
location[0] = first;
stype[0] = 1;
vector < pair <int, int> > arr;
int i, l = 0;
for(i = 1; i < n; i++) {
arr.push_back({query(0, i), i});
}
sort(arr.begin(), arr.end());
int r = arr[0].second;
location[r] = arr[0].first + first;
stype[r] = 2;
for(i = 1; i < arr.size(); i++) {
int k = arr[i].second;
int dst = location[r] - location[l];
if(query(l, k) < dst) {
location[k] = location[l] + query(l, k);
stype[k] = 2;
continue;
}
if(query(r, k) < dst) {
location[k] = location[r] - query(r, k);
stype[k] = 1;
continue;
}
if(query(l, k) < query(r, k)) {
location[k] = location[l] + query(l, k);
stype[k] = 2;
r = k;
}
else {
location[k] = location[r] - query(r, k);
stype[k] = 1;
l = k;
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
