# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
756506 | Olympia | Schools (IZhO13_school) | C++17 | 199 ms | 25096 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 <vector>
#include <iostream>
#include <cassert>
#include <random>
#include <cmath>
#include <map>
#include <algorithm>
#include <bitset>
#include <random>
#include <queue>
#include <set>
#include <stack>
#define ll int64_t
using namespace std;
bool comp (pair<int64_t, int64_t> p1, pair<int64_t, int64_t> p2) {
return (p1.first - p1.second < p2.first - p2.second);
}
vector<ll> get_max (vector<ll> v, int k) {
multiset<ll> best;
vector<ll> ans;
ans.push_back(-1e17);
ll sum = 0;
for (int i = 0; i < v.size(); i++) {
if (i <= k - 1) {
best.insert(v[i]);
sum += v[i];
} else {
if (v[i] >= *(best.begin())) {
sum -= *(best.begin());
best.erase(best.find(*(best.begin())));
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |