# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
985589 | alextodoran | Construction of Highway (JOI18_construction) | C++17 | 3 ms | 10740 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.
/**
_ _ __ _ _ _ _ _ _
|a ||t ||o d | |o |
| __ _| | _ | __| _ |
| __ |/_ | __ /__\ / _\|
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N_MAX = 100000;
int N;
int C[N_MAX + 2];
int A[N_MAX + 2], B[N_MAX + 2];
vector <int> adj[N_MAX + 2];
int order[N_MAX + 2];
void compress () {
iota(order + 1, order + N + 1, 1);
sort(order + 1, order + N + 1, [&] (const int &u, const int &v) {
return C[u] < C[v];
});
int curr = 0, last = 0;
for (int i = 1; i <= N; i++) {
if (C[order[i]] > last) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |