# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
717243 | schiftyfive4 | Road Closures (APIO21_roads) | C++14 | 87 ms | 50320 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>
#include "roads.h"
using namespace std;
#ifdef LOCAL
#include "debug.hpp"
#else
#define debug(...) "MJ >> LAMELO"
#endif
struct kset {
int n = 1e9;
multiset<long long, greater<long long>> s;
long long sum = 0;
vector<pair<int, long long>> ops;
void clip(int k) {
n = k;
while ((int) s.size() > n) {
sum -= *s.begin();
s.erase(s.begin());
}
}
void insert(long long x) {
sum += x;
s.insert(x);
ops.emplace_back(1, x);
if ((int) s.size() > n) {
sum -= *s.begin();
ops.emplace_back(0, *s.begin());
s.erase(s.begin());
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |