# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
767568 | PurpleCrayon | Chorus (JOI23_chorus) | C++17 | 429 ms | 2032 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 sz(v) int(v.size())
#define ar array
typedef long long ll;
const int N = 5e3+10, MOD = 1e9+7;
const ll INF = 1e18+10;
int n, K, small[N];
ll ps[N], l_use[N];
vector<int> one, two;
// min CHT with
// - slopes decreasing
// - query x increasing
struct Line {
ll m, b;
ll calc(ll x) {
return m * x + b;
}
};
struct CHT {
deque<Line> lines;
void add(ll m, ll b) {
while (sz(lines) >= 2) {
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... |