# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
72002 | ----------넘사벽---------- (#118) | 박스런 (FXCUP3_box) | C++11 | 180 ms | 5564 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define N 500005
using namespace std;
typedef pair<int, int> pp;
int h[N];
stack<pp> st;
int main(){
int n, i;
scanf("%d", &n);
for(i=1;i<=n;i++) scanf("%d", h+i);
st.push(pp(0, INT_MAX));
int c=1;
for(i=1;i<=n;i++){
while(!st.empty()&&st.top().second<h[i]) st.pop();
while(c<i-st.top().first){
//printf("%d ", i);
printf("%d ", i-c);
c++;
}
st.push(pp(i, h[i]));
}
while(c<=n){printf("-1 ");c++;}
printf("\n");
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |