일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 13237
- 라즈비안
- raspberrypi
- 파이썬
- NAV
- 라즈베리파이3b+
- springboot3.x
- MongoDB
- HTML
- 라즈베리파이
- dp
- ubuntu
- Crawling
- node.js
- nav-tab
- algotythm
- 2579
- Python
- 트리
- dynaminprogramming
- 알고리즘
- 백준
- CSS
- 라즈베리파이3
- 크롤링
- bootstrap
- 16.04
- 2909
- Algorythm
- baekjun
Archives
- Today
- Total
목록4949 (1)
노트
[백준] 4949번 균형잡힌 세상 python
3번이나 틀렸다고 나와서 뭐지 했는데 아이패드로 풀어서 예제 복사할때 줄바꿈이 안됐던거였다.. 데탑으로 푸니 잘됨 q = [] while True: s = input() if s=='.': break for i in range(len(s)): if s[i] == '.': if len(q) == 0: print('yes') else: print('no') q = [] continue if s[i] == '(' or s[i] == ')' or s[i] == '[' or s[i] == ']': q.append(s[i]) if len(q) > 0: if s[i] == ')' and q[len(q) - 2] == '(': q.pop() q.pop() if s[i] == ']' and q[len(q) - 2] ==..
알고리즘
2023. 7. 11. 22:06