思路:模拟题。直接用一个cnt变量,表示模拟栈括号匹配时的深度,然后每次成功匹配一个')'时,更新答案,最终输出结果即可 代码: import sys input = lambda: sys.stdin.readline().strip() import math inf = 10 ** 18 def I(): return input() def II(): return int(input()) def MII(): return map(int, input().split()) def GMI(): return map(lambda x: int(x) - 1, input().sp...