Skip to content

Commit

Permalink
[Gold III] Title: 탑 보기, Time: 28 ms, Memory: 4120 KB -BaekjoonHub
Browse files Browse the repository at this point in the history
  • Loading branch information
belowyoon committed Apr 26, 2024
1 parent 14a58aa commit 359d35c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions 백준/Gold/22866. 탑 보기/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

### 성능 요약

메모리: 4120 KB, 시간: 32 ms
메모리: 4120 KB, 시간: 28 ms

### 분류

자료 구조, 스택

### 제출 일자

2024년 4월 26일 02:07:37
2024년 4월 27일 02:30:00

### 문제 설명

Expand Down
6 changes: 0 additions & 6 deletions 백준/Gold/22866. 탑 보기/탑 보기.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ int main() {

for (int i = n-1; i >= 1; i--) {
if (arr[i+1] > arr[i]) {
while (!r.empty() && arr[r.top()] <= arr[i+1]) {
r.pop();
}
r.push(i+1);
} else {
while (!r.empty() && arr[r.top()] <= arr[i]) {
Expand All @@ -41,9 +38,6 @@ int main() {
l.pop();
}
} else if (arr[i-1] > arr[i]) {
while (!l.empty() && arr[l.top()] <= arr[i-1]) {
l.pop();
}
l.push(i-1);
}
size[i] += l.size();
Expand Down

0 comments on commit 359d35c

Please sign in to comment.