# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
751262 | dsyz | Discharging (NOI20_discharging) | C++17 | 138 ms | 33596 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;
#define MAXN (1000005)
struct ConvexHull {
deque<pair<ll,ll> > dq;
ll f(pair<ll,ll> line,ll x){
return line.first * x + line.second;
}
ll query(ll x){
while(dq.size() > 1){
if(f(dq[0],x) < f(dq[1],x)){
dq.pop_front();
}else{
break;
}
}
return f(dq[0],x);
}
long double Intersect(ll a,ll b,ll c,ll d){
return (long double)(d - b) / (a - c);
}
long double intersect(pair<ll,ll> p1,pair<ll,ll> p2){
return Intersect(p1.first,p1.second,p2.first,p2.second);
}
void ins(ll m,ll c){
pair<ll,ll> line = make_pair(m,c);
while(dq.size() > 1){
ll s = dq.size();
if(intersect(dq[s - 1],line) <= intersect(dq[s - 2],line)){
# | 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... |