# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
596716 | Temmie | Sky Walking (IOI19_walk) | C++17 | 157 ms | 20132 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 <bits/stdc++.h>
long long min_distance(std::vector <int> a, std::vector <int> h,
std::vector <int> l, std::vector <int> r, std::vector <int> y,
int s, int e) {
if (e < s) {
std::swap(s, e);
}
int n = a.size();
int m = y.size();
std::vector <std::vector <std::pair <int, bool>>> inds(n + 1);
for (int i = 0; i < m; i++) {
inds[l[i]].emplace_back(y[i], true);
inds[r[i] + 1].emplace_back(y[i], false);
}
inds[1].emplace_back(0, false);
std::map <int, long long> mp;
mp[0] = 0;
std::set <int> st;
for (int i = 0; i < n; i++) {
for (auto p : inds[i]) {
if (!p.second && !st.count(p.first)) {
mp.erase(p.first);
}
}
st.clear();
for (auto p : inds[i]) {
if (p.second) {
auto it = mp.lower_bound(p.first);
long long val = 1LL << 60;
# | 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... |