# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
935178 | kim | Chorus (JOI23_chorus) | C++17 | 1444 ms | 55672 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;
using pii=pair<int,int>;
#define f first
#define s second
#define eb emplace_back
const ll inf=1e18;
int a[1000005],b[1000005],pos[1000005],pos2[1000005];
ll qs[1000005];
pair<ll,int> dp2[1000005];
struct line{
ll m,c;
int cnt;
line(ll m,ll c,int cnt):m(m),c(c),cnt(cnt){}
ll operator()(const ll x)const{return m*x+c;}
};
struct cht{
deque<line> dq;
bool check(line a,line b,line c){
return (a.c-b.c)*(c.m-a.m)>=(a.c-c.c)*(b.m-a.m);
}
void insert(ll m,ll c,int cnt){
line f(m,c,cnt);
while(dq.size()>1&&check(dq.end()[-2],dq.back(),f)) dq.pop_back();
dq.eb(f);
}
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... |