Type: Default 1000ms 256MiB

括号匹配

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

2024022103

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
9
Start at
2024-2-21 17:00
End at
2024-2-21 18:30
Duration
1.5 hour(s)
Host
Partic.
10