# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
584999 | mosiashvililuka | Discharging (NOI20_discharging) | C++14 | 288 ms | 107092 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;
const long long N=999999999999999999LL;
long long a,b,c,d,e,i,j,ii,jj,zx,xc,f[1000009],dp[1000009],K,B,X,z;
deque <pair <long long, long long > > de;
pair <long long, long long> seg[4000009];
deque <pair <long long, pair <long long, long long> > > SEG;
void upd(long long q, long long w, long long rr){
if(q>w) return;
if(seg[rr]==make_pair(-1LL,-1LL)){
SEG.push_back({rr,{seg[rr].first,seg[rr].second}});
seg[rr]={K,B};
return;
}
long long mid=(q+w)/2;
if(seg[rr].first*mid+seg[rr].second>K*mid+B){
SEG.push_back({rr,{seg[rr].first,seg[rr].second}});
swap(seg[rr].first,K);swap(seg[rr].second,B);
}
if(seg[rr].first*q+seg[rr].second>K*q+B){
upd(q,mid-1,rr*2);
}else{
if(seg[rr].first*w+seg[rr].second>K*w+B){
upd(mid+1,w,rr*2+1);
}
}
}
void read(long long q, long long w, long long rr){
if(q>w) return;
if(q==w){
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... |