# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
298519 | square1001 | Sky Walking (IOI19_walk) | C++14 | 4054 ms | 468852 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 "walk.h"
#include <set>
#include <queue>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
const long long inf = 1LL << 61;
struct edge {
int ax, bx, y;
};
struct state {
int pos; long long cost;
bool operator<(const state& s) const {
return cost > s.cost;
}
};
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) {
int N = x.size(), M = y.size();
vector<int> compy = h;
compy.insert(compy.end(), y.begin(), y.end());
sort(compy.begin(), compy.end());
compy.erase(unique(compy.begin(), compy.end()), compy.end());
int S = compy.size();
vector<vector<int> > layer(S);
for(int i = 0; i < N; ++i) {
layer[lower_bound(compy.begin(), compy.end(), h[i]) - compy.begin()].push_back(i);
}
for(int i = 0; i < M; ++i) {
layer[lower_bound(compy.begin(), compy.end(), y[i]) - compy.begin()].push_back(i + N);
# | 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... |