# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
792859 | someone | Cake 3 (JOI19_cake3) | C++14 | 1888 ms | 16640 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 int long long
using namespace std;
const int N = 2e5 + 42, INF = 1e18 + 42;
struct Perl {
int c, t;
};
Perl perl[N];
multiset<int> best, other;
int n, m, ans = -INF, deb = -1, fin = -1, sum = 0;
inline void add(int val) {
sum += val;
best.insert(val);
if((int)best.size() == m-1) {
sum -= *best.begin();
other.insert(*best.begin());
best.erase(best.begin());
}
}
inline void del(int val) {
auto it = other.find(val);
if(it == other.end()) {
sum -= val;
it = best.find(val);
best.erase(it);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |