# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
89109 | nika | Schools (IZhO13_school) | C++14 | 149 ms | 8468 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 llong;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<llong, llong> pll;
int n, m, s;
struct st {
int a, b;
void scan() {
scanf("%d%d", &a, &b);
}
bool operator<(const st &p) const {
return a - b < p.a - p.b;
}
} ss[300000];
struct pq {
priority_queue<int, vector<int>, greater<int>> q; int sz; llong sum;
pq(int sz) : sz(sz), sum(0) {}
void push(int x) {
q.push(x);
sum += x;
if (sz < q.size()) {
sum -= q.top();
q.pop();
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |