Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from sys import stdin

def main():
    plus, minus = [], []
    readline = stdin.readline
    n = int(readline())
    for _ in range(n):
        s = readline().rstrip()
        if 2 * s.count('(') - len(s) > 0:
            plus.append(s)
        else:
            minus.append(s)
    plus.sort(key = lambda x: x.count(')'))
    minus.sort(key = lambda x: x.count('('), reverse = True)

    sum = 0
    for v in ''.join(plus + minus):
        sum = sum + (1 if v == '(' else -1)
        if sum < 0 : return print('No')
    if sum != 0:
        return print('No')

    return print('Yes')

if __name__ == '__main__':
    main()


Fixed submission:
s = input()
t = input()

def main():
    if len(s) < 1 and len(s) > 10:
        print('No')
        return

    if (s.isalpha() == False or s.islower() == False):
        print('No')
        return

    if (t[-1].isalpha() == False or t[-1].islower() == False):
        print('No')
        return

    if len(t) == len(s) + 1 and t[:-1] == s:
        print('Yes')
    else:
        print('No')
    return

main()

Buggy python submission (verdict: Runtime Error):
from sys import stdin

def main():
    readline = stdin.readline
    n = int(readline())
    s = tuple(readline().strip() for _ in range(n))

    plus, minus = [], []
    for c in s:
        if 2 * c.count('(') - len(c) > 0:
            plus.append(c)
        else:
            minus.append(c)

    plus.sort(key = lambda x: x.count(')'))
    minus.sort(key = lambda x: x.count('('), reverse = True)
    plus.extend(minus)
    sum = 0
    for v in plus:
        for vv in v:
            sum = sum + (1 if vv == '(' else -1)
            if sum < 0 : return print('No')
    if sum != 0:
        return print('No')

    return print('Yes')

if __name__ == '__main__':
    main()


Fixed submission:
s = input()
t = input()

def main():
    if len(s) < 1 and len(s) > 10:
        print('No')
        return

    if (s.isalpha() == False or s.islower() == False):
        print('No')
        return

    if (t[-1].isalpha() == False or t[-1].islower() == False):
        print('No')
        return

    if len(t) == len(s) + 1 and t[:-1] == s:
        print('Yes')
    else:
        print('No')
    return

main()
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, k = map(int, input().split())

ans = 0
for i in range(k):
    if i+1 <= a:
        ans = ans + 1

    if i+1 > a + b:
        ans = ans -1

print(ans)


Fixed submission:
a, b, c, k = map(int, input().split())

ans = a
if k < a:
    ans = k
    
if k > a + b:
    ans = ans - (k - (a+b))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n,k = map(int, input().split())
    a =  list(map(int, input().split()))

    ans = [1]
    for _ in range(n-1):
        if a[ans[-1]-1] in set(ans):
            start = ans.index(a[ans[-1]-1])
            break
        ans.append(a[ans[-1]-1])

    if k > start:
        index = (k - start) % (len(ans) - start) + start
        t = ans[index]
    else:
        t = ans[k]
    return print(t)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, k = map(int, input().split())
    a =  list(map(int, input().split()))

    path = [1]
    for _ in range(n-1):
        path.append(a[path[-1]-1])

    if k > n:
        start = path.index(path[-1])
        index = (k - start) % (len(path) - start - 1) + start
        t = path[index]
    else:
        t = path[k]
    return print(t)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n,k = map(int, input().split())
    a =  list(map(int, input().split()))

    ans = [1]
    for _ in range(n):
        if a[ans[-1]-1] in ans:
            start = ans.index(a[ans[-1]-1])
            break
        ans.append(a[ans[-1]-1])

    if k > start:
        index = (k - start) % (len(ans) - start) + start
        t = ans[index]
    else:
        t = ans[k]
    return print(t)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, k = map(int, input().split())
    a =  list(map(int, input().split()))

    path = [1]
    for _ in range(n-1):
        path.append(a[path[-1]-1])

    if k > n:
        start = path.index(path[-1])
        index = (k - start) % (len(path) - start - 1) + start
        t = path[index]
    else:
        t = path[k]
    return print(t)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n,k = map(int, input().split())
    a =  list(map(int, input().split()))

    t = 1
    ans = [1]
    while True:
        if a[t-1] in ans:
            start = ans.index(a[t-1])
            break
        ans.append(a[t-1])
        t = a[t-1]

    if k > start:
        index = (k - start) % (len(ans) - start) + start
        t = ans[index]
    else:
        t = ans[k]
    return print(t)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, k = map(int, input().split())
    a =  list(map(int, input().split()))

    path = [1]
    for _ in range(n-1):
        path.append(a[path[-1]-1])

    if k > n:
        start = path.index(path[-1])
        index = (k - start) % (len(path) - start - 1) + start
        t = path[index]
    else:
        t = path[k]
    return print(t)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int, input().split())
if B//A > C
    print(C)
else:
    print(B//A)

Fixed submission:
A,B,C = map(int, input().split())
if B//A > C:
    print(C)
else:
    print(B//A)
Buggy python submission (verdict: Runtime Error):
n,m=map(int, input().split())
l = [[int(i) for i in input().split()] for i in range(m)]

for i in range(m):
    l[i].append(i)
l = sorted(l,key=lambda x: (x[0],x[1]))

l[0].append(1)
for i in range(1,m):
    if l[i][0]!=l[i-1][0]:
        l[i].append(1)
    else:
        l[i].append(l[i-1][3]+1)

for i in range(m):
    l[i].append(str(l[i][0]).zfill(6) + l[i][3].zfill(6))

l=sorted(l,key=lambda x:(x[2]))

for i in range(m):
    print(l[i][4])

Fixed submission:
n,m=map(int, input().split())
l = [[int(i) for i in input().split()] for i in range(m)]

for i in range(m):
    l[i].append(i)
l = sorted(l,key=lambda x: (x[0],x[1]))

l[0].append(1)
for i in range(1,m):
    if l[i][0]!=l[i-1][0]:
        l[i].append(1)
    else:
        l[i].append(l[i-1][3]+1)

for i in range(m):
    l[i].append(str(l[i][0]).zfill(6) + str(l[i][3]).zfill(6))

l=sorted(l,key=lambda x:(x[2]))

for i in range(m):
    print(l[i][4])

Buggy python submission (verdict: Runtime Error):
n,m=map(int, input().split())
l=[input().split() for i in range(m)]
m={}
for j in range(len(l)):
    if l[j][0] not in m.keys():
        m[l[j][0]]=[]
    m[l[j][0]].append(l[j][1])
lab=[0]*(n+1)
for k in m.keys():
    m[k] = sorted(m[k], reverse=False)
    p='0'*(6-len(k))+k
    for h in range(len(m[k])):
        q='0'*(6-len(str(h+1)))+str(h+1)
        key=l.index([k,m[k][h]])
        lab[key]=p+q
for v in lab:
    print(v)


Fixed submission:
n,m=map(int, input().split())
l = [[int(i) for i in input().split()] for i in range(m)]

for i in range(m):
    l[i].append(i)
l = sorted(l,key=lambda x: (x[0],x[1]))

l[0].append(1)
for i in range(1,m):
    if l[i][0]!=l[i-1][0]:
        l[i].append(1)
    else:
        l[i].append(l[i-1][3]+1)

for i in range(m):
    l[i].append(str(l[i][0]).zfill(6) + str(l[i][3]).zfill(6))

l=sorted(l,key=lambda x:(x[2]))

for i in range(m):
    print(l[i][4])
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(m)]
lst = sorted(lst, key=lambda x:x[0], reverse=False)
ans = 0
#カバーできてないもののうち終了時間の最も早いものを取る
while len(lst)>0:
    ans+=1
    rest = []
    et = min(lst, key=lambda x:x[1])[1]
    flag = False
    for i in range(len(lst)):
        if lst[i][0]>=et:
            lst=lst[i:]
            flag=True
            break
    if not flag:
        break
print(ans)

Fixed submission:
#O(n)で実装
n,m = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(m)]
rest = sorted(lst, key=lambda x:x[1], reverse=False)
ans = 1
et = rest[0][1] #end_time
for i in range(len(rest)):
    if rest[i][0]>=et:
        et=rest[i][1]
        ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(m)]
lst = sorted(lst, key=lambda x:x[1], reverse=False)
ans = 0
#カバーできてないもののうち終了時間の最も早いものを取る
while len(lst)>0:
    ans+=1
    rest = []
    et = lst[0][1]
    for l in lst:
        if l[0]>=et:
            rest.append(l)
    lst = rest
print(ans)

Fixed submission:
#O(n)で実装
n,m = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(m)]
rest = sorted(lst, key=lambda x:x[1], reverse=False)
ans = 1
et = rest[0][1] #end_time
for i in range(len(rest)):
    if rest[i][0]>=et:
        et=rest[i][1]
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
l=list(s)
b=[]
lst=[]
# bi=[bin(2**i) for i in range(0,len(s))]
for i in range(2**(len(s)-1)):
    b=list(str(bin(i))[2:].zfill(len(s)-1))
    st=l[0]
    for j in range(len(b)):
        if int(b[j]):
            st+=l[j+1]
        else:
            st+='+'+l[j+1]
    lst.append(eval(st))
print(sum(lst))

Fixed submission:
s=input()
l=list(s)
lst=[]
# bi=[bin(2**i) for i in range(0,len(s))]
for i in range(1<<(len(s)-1)):
    st=l[0]
    for j in range(len(s)-1):
        if (i>>j)&1:
            st+=l[j+1]
        else:
            st+='+'+l[j+1]
    lst.append(eval(st))
print(sum(lst))
Buggy python submission (verdict: Time Limit Exceeded):
n = list(map(int,input().split()))
p = list(map(int,input().split()))

max = 0
tmp = 0
i = 1
j = 0
start = 0
sum = 0

#print(n[0]-3)

while(j <= n[0]-n[1]):
    start = j
    for i in range(n[1]):
        #print(start)
        for k in range(1,p[start]+1):
            sum += k
        tmp = tmp + (sum/p[start])
        start = start + 1
        sum = 0
    if(max < tmp):
        max = tmp
    #print("------")
    tmp = 0
    sum = 0
    i = 1
    j = j + 1


print(max)


Fixed submission:
n = list(map(int,input().split()))
p = list(map(int,input().split()))

exp = [] #期待値のリスト
exp.append(0) #０の期待値
count = 1
max = 0
tmp = 0

for i in range(1,1001):
    exp.append(count/i)
    count = count + (i+1)

#まず最初のK個の期待値を求める
for i in range(n[1]):
    tmp = tmp + exp[p[i]]
if(tmp >= max):
    max = tmp

#尺取り法でK+1個目の期待値を足して、j(0から増えていく＝先頭の期待値)を引いていく
for j in range(n[0]-n[1]):
    #print(j,tmp)
    tmp = tmp + exp[p[j+n[1]]] - exp[p[j]]
    if(tmp >= max):
        max = tmp

print(max)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
count = 0

for i in range(len(s)):
    if(s[i] == "A"):
        if(s[i+1] == "B"):
            if(s[i+2] == "C"):
                count = count + 1

print(count)


Fixed submission:
n = int(input())
s = input()
count = 0

for i in range(len(s)-2):
    if(s[i] == "A"):
        if(s[i+1] == "B"):
            if(s[i+2] == "C"):
                count = count + 1

print(count)
Buggy python submission (verdict: Runtime Error):
n = list(map(int,input().split()))
l = list(map(int,input().split()))

length = 0;
answer = 1;
i = 0;

while length + l[i] <= n[1]:
    length = length + l[i]
    answer = answer + 1
    if(len(l) == (i+1)):
        break;
    i = i + 1

#if(answer <= n[0]):
print(answer)
#else:
#    print(n[0])

Fixed submission:
i = list(map(int,input().split()))

if i[0]<i[1]:
    print(0);
else:
    print(10);
Buggy python submission (verdict: Runtime Error):
n = list(map(int,input().split()))
l = list(map(int,input().split()))

length = 0;
answer = 1;
i = 0;

while (length + l[i]) <= n[1]:
    length = length + l[i]
    answer = answer + 1
    i = i + 1

if(answer <= n[0]):
    print(answer)
else:
    print(n[0])

Fixed submission:
n = list(map(int,input().split()))
l = list(map(int,input().split()))

length = 0;
answer = 1;
i = 0;

while length + l[i] <= n[1]:
    length = length + l[i]
    answer = answer + 1
    if(len(l) == (i+1)):
        break;
    i = i + 1

#if(answer <= n[0]):
print(answer)
#else:
#    print(n[0])
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
s_list = list(s)
count1 = 0
count2 = 0

for i in range(n):
    if(s_list[i] == '#'):
        for j in range(0,n-i-1):
            #print(s_list[j+i])
            #print(j)
            if(s_list[j+i+1] == '.'):
                #print("count")
                count1 = count1 + 1
        break


for i in range(n):
    if(s_list[i] == '#'):
        count2 = count2 + 1


if(count1 < count2):
    print(count1)
else:
    print(count2)


Fixed submission:
i = list(map(int,input().split()))

if(i[0] < i[1]):
    if(i[0] < i[2] and i[2] < i[1]):
        print("Yes")
    else:
        print("No")

elif(i[0] > i[1]):
    if(i[1] < i[2] and i[2] < i[0]):
        print("Yes")
    else:
        print("No")

else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

n= int(input())

l = [100,101,102,103,104,105]
res = [comb for i in range(1,10**5) for comb in combinations(l, i) if sum(comb) == n]

if len(res) >= 1:
  print(1)
else:
  print(0)

Fixed submission:
x = int(input())

n = x%100

q,r=divmod(n,5)

if r:
  q+=1

if x//100 >= q:
  print(1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):

s = input()

d = ['SUN', 'MON', 'TUE', 'WEN', 'THU', 'FRI', 'SAT']

if s == 'SUN':
  print(0)
else:
  print(7- d.index(s))

Fixed submission:
s = input()

d = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']

print(7- d.index(s))

Buggy python submission (verdict: Runtime Error):
s = input()

d = ['SUN', 'MON', 'TUE', 'WEN', 'THU', 'FRI', 'SAT']

index = 7- d.index(s)

print(index)



Fixed submission:
s = input()

d = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']

print(7- d.index(s))
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]

mod = 10**9+7
dp = [0]*(n+1)
dp[0]=1

if not 1 in a:
  dp[1]=1

for i in range(2, n+1):
  if i in a:
    continue
  else:
    dp[i] = dp[i-1]+dp[i-2]

print(dp[n]%mod)


Fixed submission:
n, m = map(int, input().split())
a = {int(input()) for _ in range(m)}

mod = 10**9+7
dp = [0]*(n+1)
dp[0]=1

if not 1 in a:
  dp[1]=1

for i in range(2, n+1):
  if i in a:
    continue
  else:
    dp[i] = dp[i-1]+dp[i-2]

print(dp[n]%mod)
Buggy python submission (verdict: Runtime Error):
n = list(map(int, input().split()))
N = n[0]
K = n[1]

d = list(map(int, input().split()))

num = [i for i in range(1,10)]
for i in d:
  if i == 0:
    continue
  else:
    num.remove(i)

total = N*min(num)
if total > N:
  print(N)
else:
  print(total)

Fixed submission:
n = list(map(int, input().split()))

i = sum(n)

if i % 17 == 0:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
n = list(map(int, input().split()))
N = n[0]
K = n[1]

d = list(map(int, input().split()))

num = [i for i in range(1,10)]

dd = []

for i in d:
  num.remove(i)

total = 1000*min(num)
print(total)

Fixed submission:
N,K=map(int,input().split())
D=list(map(int,input().split()))
def solve():
  for i in range(10*N+2):
    if i>=N:
      s=str(i)
      for j in range(len(s)):
        if int(s[j]) in D: break
      else:
        print(i)
        return 0
 
solve()

Buggy python submission (verdict: Runtime Error):
n = list(map(int, input().split()))
N = n[0]
K = n[1]

d = list(map(int, input().split()))

num = [i for i in range(1,10)]

dd = []

for i in d:
  num.remove(i)

a = 0
for i in num:
  a += i*1000
print(a)

Fixed submission:
N,K=map(int,input().split())
D=list(map(int,input().split()))
def solve():
  for i in range(10*N+2):
    if i>=N:
      s=str(i)
      for j in range(len(s)):
        if int(s[j]) in D: break
      else:
        print(i)
        return 0
 
solve()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    input1 = input().split()
    N = int(input1[0])
    M = int(input1[1])

    H = [0]*N
    input2 = input().split()
    for i in range(N):
        H[i] = int(input2[i])
    
    A = [0]*M
    B = [0]*M
    mountain = [[0 for i in range(N)]for j in range(N)]
    for i in range(M):
        input3 = input().split()
        A[i] = int(input3[0])
        B[i] = int(input3[1])
        mountain[A[i]-1][B[i]-1] = 1
        mountain[B[i]-1][A[i]-1] = 1

    result = 0
    for i in range(N):
        error = 0
        for j in range(N):
            if mountain[i][j] == 1:
                if H[i] <= H[j] and i != j:
                    error = 1
        if error == 0:
            result += 1

    print(result)

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    input1 = input().split()
    N = int(input1[0])
    M = int(input1[1])

    H = [0]*N
    input2 = input().split()
    for i in range(N):
        H[i] = int(input2[i])
    
    A = [0]*M
    B = [0]*M
    for i in range(M):
        input3 = input().split()
        A[i] = int(input3[0])
        B[i] = int(input3[1])

    mountain = [0]*N
    for i in range(M):
        if H[A[i]-1] <= H[B[i]-1]:
            mountain[A[i]-1] = 1
        if H[B[i]-1] <= H[A[i]-1]:
            mountain[B[i]-1] = 1
    result = 0
    for i in range(N):
        if mountain[i] == 0:
            result += 1
            
    print(result)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import math

input1 = input().split()
A = int(input1[0])
B = int(input1[1])
N = int(input1[2])

output = 0
result = 0
for x in range(N):
    result = (math.floor(A*(x+1) / B)) - A*(math.floor((x+1)/B))
    if result > output:
        output = result
    if result < output:
        break

print(output)

Fixed submission:
import math

input1 = input().split()
A = int(input1[0])
B = int(input1[1])
N = int(input1[2])

x = 0
result = 0
if N >= B-1:
    x = B-1
    result = (A*(x%B) - (A*x)%B)/B
elif N < B-1:
    x = N
    result = (A*(x%B) - (A*x)%B)/B

print(int(result))

Buggy python submission (verdict: Time Limit Exceeded):
import math

def main():
    input1 = input().split()
    A = int(input1[0])
    B = int(input1[1])
    N = int(input1[2])

    output = 0
    result = 0
    for x in range(N):
        result = (math.floor(A*(x+1) / B)) - A*(math.floor((x+1)/B))
        if result > output:
            output = result

    print(output)


if __name__ == "__main__":
    main()

Fixed submission:
import math

input1 = input().split()
A = int(input1[0])
B = int(input1[1])
N = int(input1[2])

x = 0
result = 0
if N >= B-1:
    x = B-1
    result = (A*(x%B) - (A*x)%B)/B
elif N < B-1:
    x = N
    result = (A*(x%B) - (A*x)%B)/B

print(int(result))

Buggy python submission (verdict: Time Limit Exceeded):
import math

def main():
    input1 = input().split()
    A = int(input1[0])
    B = int(input1[1])
    N = int(input1[2])

    output = 0
    result = 0
    for x in range(N+1):
        result = (math.floor(A*x / B)) - A*(math.floor(x/B))
        if result > output:
            output = result

    print(output)


if __name__ == "__main__":
    main()

Fixed submission:
import math

input1 = input().split()
A = int(input1[0])
B = int(input1[1])
N = int(input1[2])

x = 0
result = 0
if N >= B-1:
    x = B-1
    result = (A*(x%B) - (A*x)%B)/B
elif N < B-1:
    x = N
    result = (A*(x%B) - (A*x)%B)/B

print(int(result))

Buggy python submission (verdict: Time Limit Exceeded):
import math

def floor(t):
    return math.floor(t)

def main():
    input1 = input().split()
    A = int(input1[0])
    B = int(input1[1])
    N = int(input1[2])

    output = 0
    result = 0
    for x in range(N+1):
        result = floor(A*x / B) - A*floor(x/B)
        if result > output:
            output = result

    print(output)


if __name__ == "__main__":
    main()

Fixed submission:
import math

input1 = input().split()
A = int(input1[0])
B = int(input1[1])
N = int(input1[2])

x = 0
result = 0
if N >= B-1:
    x = B-1
    result = (A*(x%B) - (A*x)%B)/B
elif N < B-1:
    x = N
    result = (A*(x%B) - (A*x)%B)/B

print(int(result))
Buggy python submission (verdict: Runtime Error):
import sys

def main():
    args = sys.argv
    if int(args[0]) <= int(args[1]):
        print("unsafe")
    else:
        print("safe")

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    num = input().split()
    if int(num[0]) <= int(num[1]):
        print("unsafe")
    else:
        print("safe")

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import sys

def main():
    args = sys.argv
    if int(args[1]) <= int(args[2]):
        print("unsafe")
    else:
        print("safe")

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    num = input().split()
    if int(num[0]) <= int(num[1]):
        print("unsafe")
    else:
        print("safe")

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    input1 = input()
    N = int(input1)
    S = []
    result = 0
    for i in range(N):
        input2 = input()
        if not (str(input2)) in S:
            result += 1
            S.append(str(input2))
    
    print(result)

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    input1 = input()
    N = int(input1)
    S = [0]*N
    result = 0
    for i in range(N):
        input2 = input()
        S[i] = str(input2)

    set_S = []
    set_S = set(S)
    result = len(set_S)
    
    print(result)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import math
k = int(input())
cnt = 0
for a in range(1, k+1):
    for b in range(1, k+1):
        for c in range(1, k+1):
            cnt += math.gcd(math.gcd(a, b), c)
print(cnt)

Fixed submission:
import math
k = int(input())
cnt = 0
for a in range(1, k+1):
    for b in range(a+1, k+1):
        for c in range(b+1, k+1):
            cnt += math.gcd(math.gcd(a, b), c) * 6

for a in range(1, k+1):
    for b in range(a+1, k+1):
        cnt += math.gcd(a, b) * 6

for i in range(1, k+1):
    cnt += i
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
sList = [input() for _ in range(n)]
sSet = set(sList)
num = [[sList.count(i), i] for i in sSet]
ind = 0
ans = []
for i in range(len(sSet)):
    if ind < num[i][0]:
        ans = [num[i][1]]
        ind = num[i][0]
    elif ind == num[i][0]:
        ans.append(num[i][1])
ans.sort()
print("\n".join(ans))

Fixed submission:
from collections import Counter
n = int(input())
sList = [input() for _ in range(n)]
c = Counter(sList).most_common()
ans = []
for i in range(len(c)):
    if c[i][1] == c[0][1]:
        ans.append(c[i][0])
    else:
        break
ans.sort()
print("\n".join(ans))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input(),split())
if a*b%2 == 0:
    print("Even")
else:
    print("Odd")

Fixed submission:
a, b = map(int, input().split())
if a*b%2 == 0:
    print("Even")
else:
    print("Odd")