# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1166733 | Kerim | Split the sequence (APIO14_sequence) | C++17 | 0 ms | 324 KiB |
#include "bits/stdc++.h"
using namespace std;
#define ll long long
const ll INF=-LLONG_MAX;
bool Q;
struct Line {
mutable ll k, m, p;
int ind;
bool operator<(const Line &o) const {
return Q ? p < o.p : k < o.k;
}
};
struct LineContainer : multiset<Line> {
const ll inf = LLONG_MAX;
ll div(ll a, ll b) {
return a / b-((a ^ b) < 0 && a % b);
}
bool isect(iterator x, iterator y) {
if (y == end()) {
x->p = inf;
return false;
}
if (x->k == y->k)
x->p = (x->m > y->m ? inf : -inf);
else
x->p = div(y->m-x->m, x->k-y->k);
return x->p >= y->p;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |