673 - Parentheses Balance
来源:互联网 发布:阿里云 机房地址 编辑:程序博客网 时间:2024/05/29 15:33
Parentheses Balance
You are given a string consisting of parentheses () and []. A string of this type is said to be correct:
- (a)
- if it is the empty string
- (b)
- if A and B are correct, AB is correct,
- (c)
- if A is correct, (A) and [A] is correct.
Write a program that takes a sequence of strings of this type and check their correctness. Your program can assume that the maximum string length is 128.
Input
The file contains a positive integer n and a sequence of n strings of parentheses () and [], one string a line.Output
A sequence of Yes or No on the output file.Sample Input
3([])(([()])))([()[]()])()
Sample Output
YesNoYes
0 0
- UVa 673 Parentheses Balance
- uva 673 - Parentheses Balance
- 673 - Parentheses Balance
- Uva 673 Parentheses Balance
- UVaOJ 673 - Parentheses Balance
- uva 673 - Parentheses Balance
- UVa 673 Parentheses Balance
- UVa 673 - Parentheses Balance
- 673 - Parentheses Balance
- UVA 673 Parentheses Balance
- UVa 673 - Parentheses Balance
- UVA 673 Parentheses Balance
- UVa 673 - Parentheses Balance
- Uva-673-Parentheses Balance
- UVa 673 - Parentheses Balance
- 673 - Parentheses Balance
- uva 673Parentheses Balance
- uva-673 Parentheses Balance
- ListView优化 不用ViewHolder(Google 不推荐) SimpleAdapter 就真的Simple了吗
- 01背包 决策树模型 Python
- itercast.com学习笔记-Linux磁盘及文件系统管理
- STM8S各个模块初始化
- 黑马程序员_String对象
- 673 - Parentheses Balance
- Spring事务管理机制的实现原理-动态代理
- 如何让GCC检查类printf函数的参数
- [Java] 日期处理 04 总结
- IE10和IE9兼容性常见问题解答(FAQ)
- essential C++的复习
- 【踩雷】指针惹的货
- db2设置参数数据及更新
- iOS7 UI改变总结