# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
172917 | RafaelSus | Split the sequence (APIO14_sequence) | C++14 | 2045 ms | 86256 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 int N = 1e5 + 5;
typedef long long ll;
const ll inf=1e15;
#define pb push_back
const int INF=(0x3f3f3f3f);
vector<ll>m,b;
vector<int>idx;
int ptr;
void add(ll _m,ll _b,int _idx){
int sz=m.size();
while(sz>=2&&(_b-b[b.size()-2])*(m[m.size()-2]-m.back())>=(b.back()-b[b.size()-2])*(m[m.size()-2]-_m)){
m.pop_back();
b.pop_back();
idx.pop_back();
sz--;
}
m.pb(_m);
b.pb(_b);
idx.pb(_idx);
}
ll func(int pos,ll x){
return m[pos]*x+b[pos];
}
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... |