括号匹配中配版

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

假设表达式中允许包含两种括号:圆括号和中括号,其嵌套的顺序随意,但需要成对出现。即([])或[] ()()等为正确的格式,)([为不正确的格式。 给定一串括号输入(换行作为结束符),检测格式是否正确,若正确输出YES;错误输出NO。 (括号数量≤100)

输入描述

输出描述

样例输入 1

()[]

样例输出 1

YES

202402240000

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
22
Start at
2024-2-24 13:00
End at
2024-2-24 15:30
Duration
2.5 hour(s)
Host
Partic.
9