2019-11-15: init

This commit is contained in:
2019-11-15 03:29:24 +09:00
commit 9780f1b736
32 changed files with 633 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
Glevel = 0
Nlevel = 0
testCase = int(input())
isVPS = True
for i in range(testCase):
inString = input()
if len(inString) % 2:
print("NO")
continue
for i in inString:
if i == "(":
Glevel += 1
elif i == ")":
Glevel -= 1
if Glevel < 0:
isVPS = False
break
if isVPS and Glevel == 0:
print("YES")
else :
print("NO")
isVPS = True
Glevel = 0