# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
807524 | faruk | Sky Walking (IOI19_walk) | C++17 | 4059 ms | 779316 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 <bits/stdc++.h>
#define mp make_pair
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
vector<vector<pii> > graph;
vector<map<ll, ll> > idxs; // for each i , idxs[i][a] is index of node at that llersection
vector<ll> x;
ll n;
ll get_idx_at_height(ll a, ll h) {
ll my_node = idxs[a][h];
if (my_node == 0)
{
my_node = graph.size(), idxs[a][h] = my_node;
graph.push_back(vector<pii>());
}
return my_node;
}
void add_edge(ll a, vector<ll> nei, ll h) {
ll my_node = get_idx_at_height(a, h);
for (ll b : nei) {
ll idx = get_idx_at_height(b, h);
graph[idx].push_back(mp((ll)my_node, (ll)abs(x[a] - x[b])));
# | 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... |