Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Tags
- ubuntu
- OS
- linux
- Scheduling
- Util
- macos
- node.js
- docker
- S3
- AWS
- Kotlin
- typeorm
- algorithm
- sequelize
- DATABASE
- python
- MongoDB
- Crawling
- Android
- postman
- css
- HTML
- OOAD
- TypeScript
- Express
- Network
- React
- mongoose
- mysql
- wireshark
Archives
- Today
- Total
목록
반응형
Stack (1)
반응형
SW
제약 사항 시간 제한 : 1.5 초 메모리 제한 : 128MB 문제 입력 출력 예제 입력 5 6 9 5 7 4 예제 출력 0 0 2 2 4 잘못된 접근 방식 import sys input = sys.stdin.readline n = int(input()) li = list(map(int, input().rstrip().split())) result = [] for i in range(len(li)-1, -1, -1): temp = li[i] st = [] if i == 0: # 맨 앞의 탑인 경우 result.append(0) else: for j in range(i-1, -1, -1): # 이전 탑들의 높이 탐색 if li[j] > temp and not st: st.append((li[j], j+1)..
Algorithm
2022. 10. 10. 14:45