# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
13136 | choyi0521 | 수열 (APIO14_sequence) | C++98 | 0 ms | 91708 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
#define MaxN 100001
typedef long long int lint;
typedef struct Line{
lint m;
lint b;
int from;
Line(){m=b=from=0;}
Line(lint _m,lint _b,int _from){m=_m;b=_b;from=_from;}
}line;
line l[MaxN];
int ans[220][MaxN],p,sz;
int n,c;
lint sum[MaxN],dy1[MaxN],dy2[MaxN];
double cross(line i,line j){return (double)(i.b-j.b)/(j.m-i.m);}
void push(line t){
while(sz>=2 && cross(t,l[sz])<cross(l[sz-1],l[sz])) sz--;
l[++sz]=t;
}
int main(){
int i,j;
scanf("%d %d",&n,&c);
for(i=1; i<=n; i++){
scanf("%d",&sum[i]);
sum[i]+=sum[i-1];
}
p=1;
push(Line(0,0,0));
for(i=1; i<=c; i++){
for(j=i; j<n; j++){
# | 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... |