TÓPICO
time limit exceeded
pgates perguntou 3 years ago
result = []
e = 0
d= 0
while True:
try:
N=input()
N = list(N)
tam = len(N)
for i in range(tam):
if (N[i] == '('):
e += 1
for j in range(i, tam):
if (N[j] == ')'):
d += 1
N[j] = '.'
if (e == d):
result.append("correct")
else:
result.append("incorrect")
d = 0
e = 0
except EOFError:
break
print(*result, sep = "\n")
Alguém sabe um jeito de diminuir o tempo
Este tópico ainda não foi respondido. Seja o primeiro!