www.acmicpc.net/problem/9012 9012번: 괄호 괄호 문자열(Parenthesis String, PS)은 두 개의 괄호 기호인 ‘(’ 와 ‘)’ 만으로 구성되어 있는 문자열이다. 그 중에서 괄호의 모양이 바르게 구성된 문자열을 올바른 괄호 문자열(Valid PS, VPS)이라고 www.acmicpc.net #include #include using namespace std; int main() { int n; cin >> n; while (n--) { stack st; string c, r; cin >> c; for (int i = 0; i < c.length(); i++) { if (c[i] == '(') st.push(c[i]); else if (st.empty() && c[i]..
www.acmicpc.net/problem/10828 10828번: 스택 첫째 줄에 주어지는 명령의 수 N (1 ≤ N ≤ 10,000)이 주어진다. 둘째 줄부터 N개의 줄에는 명령이 하나씩 주어진다. 주어지는 정수는 1보다 크거나 같고, 100,000보다 작거나 같다. 문제에 나와있지 www.acmicpc.net #include #include #include using namespace std; int main() { stack st; int n; cin >> n; while (n--) { string cmd; cin >> cmd; if (cmd == "push") { int x; cin >> x; st.push(x); } else if (cmd == "pop") { if (st.empty()) cout
- Total
- Today
- Yesterday
- 피보나치
- 더하기
- programmers
- 나머지
- 파이썬
- 괄호
- math
- 백준
- 직업군 추천
- 2
- 넓이
- openCV
- 다익스트라
- 프로그레머스
- 꿀따기
- 👼
- 21758
- 카카오 2021 블라인드 테스트
- 스택
- forensic
- python
- web
- c++
- 쇠막대기
- 4
- 7567
- boj
- 1
- HackCTF
- FIBO
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |