# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
997999 | Nailuj_217 | Toll (BOI17_toll) | C++17 | 187 ms | 41916 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>
#define l long long
using namespace std;
struct LayerConnnection {
l startlayer, endlayer;
array<array<l, 5>, 5> min_weights;
};
l k, n, m, q;
const l LEN = 50005;
const l INF = 1LL<<60;
array<vector<pair<l, l>>, LEN> adj;
array<array<l, 20>, LEN> adj_matrix;
array<LayerConnnection, LEN*4+10> tree;
LayerConnnection build_tree(l i, l s, l f) {
for (int a = 0; a < 5; a++) tree[i].min_weights[a].fill(INF);
tree[i].startlayer = s;
tree[i].endlayer = f;
if (s == f) {
for (int a = 0; a < k; a++) tree[i].min_weights[a][a] = 0;
return tree[i];
}
LayerConnnection left = build_tree(i*2, s, (s+f)/2);
# | 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... |