# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
233066 | oolimry | Cake 3 (JOI19_cake3) | C++14 | 3656 ms | 19228 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 C first
#define V second
using namespace std;
typedef pair<long long, long long> ii;
int n, m;
long long op[300005];
ii arr[200005];
struct maxM{
multiset<long long> take;
multiset<long long> notake;
long long total = 0;
int l = -1, r = -1;
void include(long long pos){
long long x = arr[pos].V;
if(l == -1){
l = pos; r = pos;
}
else{
r++;
}
//cout << "INC: " << x << endl;
take.insert(x); total += x;
if((int) take.size() > m){
auto it = take.begin();
total -= *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... |