括号序列
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.
题目描述
小明有一个括号序列。
这个括号序列,由于某种原因,被改了,导致它不是合法的括号序列了。
括号序列的定义我们此处就不赘述了。
问:小明最少要修改多少个位置,才能使得它变成一个合法的括号序列。
输入格式
第一行输入一个括号序列。
输出格式
输出一个数字表示答案。
(()))(
2
))((
2
)))(((
4
((()()))))())))((())(())(()))()()()()))()))(
6
数据范围
对于30%的数据:。
对于100%的数据:。保证长度一定是偶数。
0906
- Status
- Done
- Rule
- IOI
- Problem
- 7
- Start at
- 2025-9-6 14:00
- End at
- 2025-9-6 18:00
- Duration
- 4 hour(s)
- Host
- Partic.
- 61