# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1116957 | vladilius | Holiday (IOI14_holiday) | C++17 | 5050 ms | 2616 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;
using ll = long long;
using pii = pair<int, int>;
using pli = pair<ll, int>;
#define pb push_back
#define ff first
#define ss second
ll get(vector<int> a, int n, int x, int d){
auto f = [&](int l, int r){
int f = d - (x - l) - (r - l);
vector<int> p;
for (int i = l; i <= r; i++){
p.pb(a[i]);
}
sort(p.begin(), p.end(), greater<int>());
ll sum = 0;
for (int i = 0; i < min(f, (int) p.size()); i++){
sum += p[i];
}
return sum;
};
ll out = 0;
function<void(int, int, int, int)> solve = [&](int l, int r, int l1, int r1){
if (l > r) return;
int m = (l + r) / 2;
pli mx = {-1, 0};
for (int i = l1; i <= r1; i++){
mx = max(mx, {f(m, i), -i});
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |