# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
125274 | dragonslayerit | Mountains (IOI17_mountains) | C++14 | 42 ms | 28024 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "mountains.h"
#include <vector>
#include <algorithm>
#include <cstdio>
int first[2001][2001];//if i is required
int best[2001][2001];
//Is there a case that breaks the algorithm assuming first=best?
int maximum_deevs(std::vector<int> y) {
for(int i=0;i<y.size();i++){
first[i][i+1]=1;
best[i][i+1]=1;
}
for(int i=y.size()-1;i>=0;i--){
int k=i+1;
for(int j=i+2;j<=y.size();j++){
first[i][j]=first[i][k]+best[k+1][j];
best[i][j]=std::max(first[i][j],best[i+1][j]);
if(1LL*(k-i)*(y[j]-y[i])>=1LL*(j-i)*(y[k]-y[i])){
k=j;
}
}
}
return best[0][y.size()];
}
컴파일 시 표준 에러 (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... |