# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
646011 | Alex_tz307 | Paths (RMI21_paths) | C++17 | 379 ms | 35344 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>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
const int kN = 1e5;
int n, k;
int64_t sumK, sol[1 + kN];
pair<int64_t, int> dmax[1 + kN];
vector<pair<int, int>> g[1 + kN];
set<pair<int64_t, int>> paths[1 + kN];
multiset<int64_t> low, big;
static inline void fix() {
while ((int)big.size() < k && !low.empty()) {
auto it = --low.end();
big.emplace(*it);
sumK += *it;
low.erase(it);
}
if (low.empty() || big.empty()) {
return;
}
int64_t last = *(--low.end()), first = *big.begin();
while (first < last) {
big.erase(big.begin());
sumK -= first;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |