| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 798688 | resting | Sky Walking (IOI19_walk) | C++17 | 10 ms | 2232 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "walk.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
// long long min_distance(std::vector<int> x, std::vector<int> h, std::vector<int> l, std::vector<int> r, std::vector<int> y, int s, int g) {
// }
long long min_distance(std::vector<int> x, std::vector<int> h, std::vector<int> l, std::vector<int> r, std::vector<int> y, int s, int g) { // basically dijkstra
int n = x.size(), m = l.size();
map<pair<int, int>, ll> dist;
set<pair<ll, pair<int, int>>> ss;
ss.insert({ 1, {s, 0} });
while (ss.size()) {
auto t = *ss.begin();
ss.erase(ss.begin());
int tim = t.first, xx = t.second.first, yy = t.second.second;
if (dist[t.second]) break;
dist[t.second] = t.first;
for (int i = 0; i < m; i++) {
if (y[i] == yy && l[i] <= xx && r[i] > xx) ss.insert({ tim + x[xx + 1] - x[xx], {xx + 1, yy} });
if (y[i] == yy && l[i] < xx && r[i] >= xx) ss.insert({ tim + x[xx] - x[xx - 1], {xx - 1, yy} });
if (l[i] <= xx && r[i] >= xx && h[xx] >= y[i]) ss.insert({ tim + abs(y[i] - yy), {xx, y[i]} });
}
ss.insert({tim + yy, {xx, 0} });
}
return dist[{g, 0}];
}
// int main() {
// }
컴파일 시 표준 에러 (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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
