# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
707970 | pauloamed | Potatoes and fertilizers (LMIO19_bulves) | C++14 | 445 ms | 28836 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;
#define int long long
#define mp make_pair
template<typename T> struct OffsetPq :
priority_queue<int,vector<int>,T> {
int offset = 0;
void push(int x) {
priority_queue<int,vector<int>, T>::push(x - offset);
}
int top() {
return priority_queue<int,vector<int>,T>::top() + offset;
}
void addToOffset(int x) {
offset += x;
}
};
struct PiecewiseConvex{
int a, b; // ax + b
OffsetPq<less<int>> slopeChangeUntil0;
OffsetPq<greater<int>> slopeChangeAfter0;
PiecewiseConvex(int _a=0, int _b=0):a(_a), b(_b){}
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |