# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
150893 | dragoon | Organizing the Best Squad (FXCUP4_squad) | C++17 | 1034 ms | 55460 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 "squad.h"
#include<vector>
#include<algorithm>
#include<assert.h>
#include<utility>
using namespace std;
typedef long long LL;
//StaticCHT<LL> cht;
//cht.InsertLine({ id, m, c });
//auto ret = cht.SlidingEval(x);
template<class T = LL>
struct Line {
int id;
// y = mx + c
T m, c;
// The line starts from start_x.
static const LL MIN_START_X = 0;
long double start_x;
LL Eval(LL x) { return m * x + c; }
long double Eval(long double x) { return m * x + c; }
long double Intersect(const Line& other) {
// mx + c = other.m * x + other.c
long double num = other.c - c;
long double den = m - other.m;
assert(m != other.m);
return num / den;
}
};
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... |