# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
84432 | MrTEK | Schools (IZhO13_school) | C++14 | 450 ms | 18284 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>
using namespace std;
typedef long long int ll;
typedef pair<int,int> ii;
const int N = 3e5 + 5;
multiset <int> l1,l2,r1,r2;
multiset <int> :: iterator it,it2;
int n,m,s,a[N],b[N],id[N];
ll suml,sumr,ans;
void add_l(int x){
if (l1.size() < m) {
suml += a[x];
l1.insert(-a[x]);
}
else if(m == 0) {
l2.insert(-a[x]);
}
else {
it = l1.end();
it--;
if (-*it < a[x]) {
suml += a[x];
suml -= -*it;
l2.insert(*it);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |