본문 바로가기

SW

검색하기
SW
프로필사진 limsw

  • 분류 전체보기 (146)
    • Docker (5)
    • Node.js (22)
    • React (7)
    • Django (3)
    • Python (33)
    • Util (7)
    • Operating System (9)
    • OpenAPI (2)
    • HTML-CSS (6)
    • Architecture (2)
    • MongoDB (4)
    • AWS (3)
    • Linux (7)
    • Database (8)
    • OOAD (6)
    • Java (4)
    • Android (7)
    • Network (5)
    • Algorithm (6)
    • ELK (0)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2026/01   »
일 월 화 수 목 금 토
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 29 30 31
Tags
  • Kotlin
  • css
  • ubuntu
  • Android
  • algorithm
  • S3
  • TypeScript
  • mysql
  • typeorm
  • wireshark
  • AWS
  • sequelize
  • python
  • Network
  • macos
  • node.js
  • HTML
  • Express
  • Util
  • DATABASE
  • linux
  • docker
  • mongoose
  • Crawling
  • React
  • OOAD
  • postman
  • Scheduling
  • MongoDB
  • OS
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록
반응형
Stack (1)

SW

[Python] 백준 2493 - 탑 (스택)

제약 사항 시간 제한 : 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
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바