본문 바로가기

시작이 반

검색하기
시작이 반
프로필사진 G_Gi

  • 분류 전체보기 (287)
    • 알고리즘 (178)
      • 백준 (90)
      • Programmers (83)
      • 활용 방법 (4)
    • Programming (98)
      • Java (9)
      • Kotlin (5)
      • Python (2)
      • MySQL (8)
      • Spring (39)
      • JPA (11)
      • MSA (13)
      • WEB (2)
      • React (1)
      • 기타 (8)
    • 기타 (7)
      • 계획 (2)
      • 면접준비 (5)
      • 포트폴리오 (0)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
일 월 화 수 목 금 토
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
  • java
  • 백준 16236
  • 웹어플리케이션 서버
  • Spring Boot
  • Coroutine
  • spring cloud
  • with recursive
  • springboot
  • 백준 파이썬
  • Spring
  • spring security
  • 백준 17779
  • 프로래머스
  • Kotlin
  • sql 기술면접
  • 백준 17626
  • JPA
  • re.split
  • 백준
  • java 기술면접
  • 백준 19238
  • spring oauth
  • 파이썬
  • MySQL
  • MSA
  • JVM
  • 백준 15685
  • 백준 16235
  • 백준 16719
  • 프로그래머스
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록백준 9012 (1)

시작이 반

[백준] 9012번 (python 파이썬)

스택에 관련된 문제이다. '('을 확인하면 stack에 쌓고 ')'을 확인하면 stack에서 pop한다. t = int(input()) for _ in range(t): ps = list(input()) stack = list() is_empty = False for i in range(len(ps)): if ps[i] == '(': stack.append(ps[i]) else: if not stack: is_empty = True break else: stack.pop() if not stack and not is_empty: print('YES') else: print('NO')

알고리즘/백준 2021. 3. 4. 16:04
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바