# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
164796 | mosiashvililuka | Money (IZhO17_money) | C++14 | 2 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,pas,f[1000009],dp[1000009];
int main(){
scanf("%d",&a);
for(b=1; b<=a; b++){
scanf("%d",&f[b]);
}
dp[0]=0;
for(b=1; b<=a; b++){
dp[b]=a+3;
for(c=b; c>=1; c--){
if(c!=b&&f[c]>f[c+1]) break;
e=0;
for(d=1; d<c; d++){
if(f[c]<f[d]&&f[d]<f[b]){
e=1;
break;
}
}
if(e==0){
if(dp[b]>dp[c-1]+1) dp[b]=dp[c-1]+1;
}
}
}
printf("%d ",dp[d]);
return 0;
}
컴파일 시 표준 에러 (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... |