# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
5686 | cki86201 | Split the sequence (APIO14_sequence) | C++98 | 516 ms | 85860 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
#include<set>
typedef long long ll;
typedef std::pair<ll,ll> pl;
#define X first
#define Y second
int n, k, s[100010];
ll d[2][100010];
int b[202][100010];
int ans[202];
struct deq{
pl p[100010];
int w[100010];
int f, r;
void init(){f=r=0;}
void push(pl x,int c){
while(f-r>1 && (p[f-1].X - p[f-2].X) * (x.Y - p[f-1].Y) >= (x.X - p[f-1].X) * (p[f-1].Y - p[f-2].Y))--f;
p[f] = x, w[f++] = c;
}
ll pop(ll x){
while(f-r>1 && (x*p[r].X + p[r].Y) <= (x*p[r+1].X + p[r+1].Y))++r;
return x*p[r].X + p[r].Y;
}
inline int prev(){return w[r];}
}Deq[2];
int main()
{
# | 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... |