Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for i in range(N)]
A_s = list(set(A))
cnt = 0
for i in A_s:
    if A.count(i) % 2 == 1:
        cnt += 1
print(cnt)

Fixed submission:
n = int(input())
paper = {}
for i in range(n):
    number = input()
    if number in paper:
        del paper[number]
    else:
        paper[number] = 1
print(len(paper))
Buggy python submission (verdict: Time Limit Exceeded):
# import statistics
N = int(input())
A = list(map(int,input().split()))
# mode = statistics.mode(A)
# print(mode)
# tar = mode
B = []
for a in A:
    count1 = A.count(a)
    count2 = A.count(a+1)
    count3 = A.count(a-1)
    cnt = count1 + count2 + count3
    B.append(cnt)
print(max(B))

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
c = []
for i in A:
    c.extend([i-1,i,i+1])
ans = Counter(c).most_common()
print(ans[0][1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
ans = 0
for i in range(N):
    li = [A[2*i],A[2*i+1],A[3*N+i-2]]
    ans += li[1]
print(ans)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
ans = 0
for i in range(N):
    ans += A[2*i+1]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 1
for i in range(1,n+1):
    ans = ans * i
print(ans%(10**9 + 7))

Fixed submission:
n = int(input())
ans = 1
for i in range(1,n+1):
    ans = (ans * i)%(10**9+7)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x = map(int,input().split())
ans = 0
for i in range(a,b+1):
    if i%x==0:
        ans += 1
print(ans)

Fixed submission:
a,b,x = map(int,input().split())
if a == 0:
    print(b//x + 1)
else:
    print((b//x) - ((a-1)//x))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
num = [None] * (N)
ans = ''
for _ in range(M):
    x, y = map(int, input().split())
    if num[x-1] == None:
        num[x-1] = str(y)
    elif num[x-1] != str(y):
        ans = -1
        break

if ans == -1:
    print(ans)
elif len(num) >= 2 and num[0] == '0':
    print(-1)
elif len(num) >= 2 and num[0] == None:
    for i in range(N):
        if i == 0:
            ans += '1'
        else:
            if i == None:
                ans += '0'
            else:
                ans += i
    print(ans)
else:
    for i in num:
        if i == None:
            ans += '0'
        else:
            ans += i
    print(ans)

Fixed submission:
N, M = map(int, input().split())
num = [None] * (N)
ans = ''
for _ in range(M):
    x, y = map(int, input().split())
    if num[x-1] == None:
        num[x-1] = str(y)
    elif num[x-1] != str(y):
        ans = -1
        break

if ans == -1:
    print(ans)
elif len(num) >= 2 and num[0] == '0':
    print(-1)
elif len(num) >= 2 and num[0] == None:
    for i in range(N):
        if i == 0:
            ans += '1'
        else:
            if num[i] == None:
                ans += '0'
            else:
                ans += num[i]
    print(ans)
else:
    for i in num:
        if i == None:
            ans += '0'
        else:
            ans += i
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a=int(input())
li = input().split()
ans = "YES"
for i in li:
    if li.count(i) > 1:
        ans = "NO"
        break
print(ans)

Fixed submission:
a=int(input())
li = input().split()
if len(li) == len(set(li)):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input().split()))
icount = 0
for i in range(n):
    if li[i] == min(li[0:i+1]):
        icount += 1
print(icount)

Fixed submission:
n, m = input().split()
if n == m :
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
icount = 0
for i in range(n):
    if li[i] == min(li[0:i+1]):
        icount += 1
print(icount)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
count = 1
min_p = p[0]
for i in range(n):
    if min_p > p[i]:
        count += 1
        min_p = p[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
icount = 0
for i in range(n):
    if li[i] == min(li[0:i+1]):
        icount += 1
print(icount)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
count = 1
min_p = p[0]
for i in range(n):
    if min_p > p[i]:
        count += 1
        min_p = p[i]
print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input().split()))
icount = 0
for i in range(n):
    if li[i] == min(li[0:i]):
        icount += 1:
print(icount)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
count = 1
min_p = p[0]
for i in range(n):
    if min_p > p[i]:
        count += 1
        min_p = p[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
icount = 0
for i in range(n):
    pi = li[i]
    for i in range(i + 1):
        if pi > li[i]:
            break
    if pi <= li[i]:
        icount += 1
print(icount)


Fixed submission:
n = int(input())
p = list(map(int,input().split()))
count = 1
min_p = p[0]
for i in range(n):
    if min_p > p[i]:
        count += 1
        min_p = p[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
icount = 0
for i in range(n):
    pi = li[i]
    for i in range(i + 1):
        if pi > li[i]:
            break
    if pi <= li[i]:
        icount += 1
print(icount)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
count = 1
min_p = p[0]
for i in range(n):
    if min_p > p[i]:
        count += 1
        min_p = p[i]
print(count)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ac = [0] * n
pen = [0] * n
pen_count = 0
for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if ac[p] == "AC":
        continue
    elif s == "AC":
        ac[p] = "AC"
    else:
        pen[p] += 1
 
for i in range(n):
    if ac[i] == "AC":
        pen_count += pen[i]
 
print(ac.count("AC"), pen_count)

Fixed submission:
c = input()
a_list= list('abcdefghijklmnopqrstuvwxyz')
for i in range(0, len(a_list)):
    if a_list[i] == c:
        i += 1
        print(a_list[i])

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ac = [0] * n
pen = [0] * n
pen_count = 0
for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if ac[p] == "AC":
        continue
    elif s == "AC":
        ac[p] = "AC"
    else:
        pen[p] += 1

for i in range(n):
    if ac[i] == "AC":
        pen_count += pen[i]

print(ac.count("AC"), pen_count)


Fixed submission:
c = input()
a_list= list('abcdefghijklmnopqrstuvwxyz')
for i in range(0, len(a_list)):
    if a_list[i] == c:
        i += 1
        print(a_list[i])

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split()) #n:問題数 m:提出回数
ac = [0] * n
pen = [0] * n
pen_count = 0
for i in range(m):
    p, s = input().split()#p = 1, s = "WA"
    p = int(p) - 1
    if ac[p] == "AC":
        continue
    elif s == "AC":
        ac[p] = "AC"
    else:
        pen[p] += 1

for i in range(n):
    if ac[i] == "AC":
        pen_count += pen[i]

print(ac.count("AC"), pen_count)

Fixed submission:
c = input()
a_list= list('abcdefghijklmnopqrstuvwxyz')
for i in range(0, len(a_list)):
    if a_list[i] == c:
        i += 1
        print(a_list[i])

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ac = [0] * n
pen = [0] * n
pen_count = 0
for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if ac[p] == "AC":
        continue
    elif s == "AC":
        ac[p] = "AC"
    else:
        pen[p] += 1

for i in range(m):
    if ac[i] == "AC":
        pen_count = pen[i]

print(ac.count("AC"), pen_count)

Fixed submission:
c = input()
a_list= list('abcdefghijklmnopqrstuvwxyz')
for i in range(0, len(a_list)):
    if a_list[i] == c:
        i += 1
        print(a_list[i])
Buggy python submission (verdict: Runtime Error):
a,b,k = input().split()
a = int(a)
b = int(b)
k = int(k)
if a => k:
    print(a-k, b)
elif a < k  and b+(a-k) >=0 :
    print(0, b+(a-k))
else:
    print(0, 0)

Fixed submission:
a,b,k = input().split()
a = int(a)
b = int(b)
k = int(k)
if a >= k:
    print(a-k, b)
elif a < k  and b+a-k >=0 :
    print(0, b+a-k)
else:
    print(0, 0)

Buggy python submission (verdict: Runtime Error):
a,b,k = input().split()
a = int(a)
b = int(b)
k = int(k)
if a - k < 0 and a+b-k <0
    print(0, 0)
elif a - k < 0:
    print(0, a+b-k)
else:
    print(a-k, b)


Fixed submission:
a,b,k = input().split()
a = int(a)
b = int(b)
k = int(k)
if a >= k:
    print(a-k, b)
elif a < k  and b+a-k >=0 :
    print(0, b+a-k)
else:
    print(0, 0)
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
print(6-a+b)

Fixed submission:
a = int(input())
b = int(input())
print(6-a-b)
Buggy python submission (verdict: Runtime Error):
k,x = map(int,input().split())

li = [i for i in range(x-k+1,x+k)]

print(' '.join(li))

Fixed submission:
k,x = map(int,input().split())

li = [str(i) for i in range(x-k+1,x+k)]

print(' '.join(li))
Buggy python submission (verdict: Runtime Error):
li = list(input())

flag = 'No'
for i in range(1,4):
    if li[0]==li[i]:
        del li[i],li[0]
        if li[0] == li[1]:
            flag = 'Yes'
            break

print(flag)

Fixed submission:
li = list(input())
li1 = li[:]

flag = 'No'
for i in range(1,4):
    if li[0]==li[i]:
        del li1[i],li1[0]
        if li1[0] == li1[1]:
            flag = 'Yes'
            break
        break
if li[0]==li1[0]:
    flag = 'No'

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

count = 0
d = 0

while d < x and count <= n:
  d += l[count]
  count += 1
  if d == x:
    count += 1

print(count)

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

count = 0
d = 0

for i in range(n):
  d += l[count]
  count += 1
  if d >= x:
    if d == x:
      count += 1
    break

print(count) if d>=x else print(count+1)
Buggy python submission (verdict: Time Limit Exceeded):
li = list(input())
count = 0

i = 0
while(i<len(li)-2):
  if(li[i]=='A' and li[i+1]=='B' and li[i+2]=='C'):
    count += 1
    li[i]='B'
    li[i+1]='C'
    li[i+2]='A'
    if(i!=0 and li[i-1]=='A'):
      i = i-1
    else:
      i = i+2
  else:
    i = i+1

print(count)



Fixed submission:
li = list(input())
count = 0



counta = 0
i = 0
while(i<len(li)-2):
  # print(i, counta, count)
  if(li[i]=='A'):
    counta += 1
    # print(i)
    if(li[i+1]=='B' and li[i+2]=='C'):
      count += counta
      li[i]='B'
      li[i+1]='C'
      li[i+2]='A'
      i = i+2
      counta -=1
    else:
      i += 1
  else:
    counta = 0
    i = i+1

print(count)
Buggy python submission (verdict: Runtime Error):
import math
N=input()
n=math.floor(N/1.08)
N1=math.floor(1.08*n)
N2=math.floor(1.08*(n+1))

if N==N1 or N==N2:
  print(n)
else:
  print(':(')

Fixed submission:
import math
N=int(input())
n=math.floor(N/1.08)
N1=math.floor(1.08*n)
N2=math.floor(1.08*(n+1))
 
if N==N1:
  print(n)
elif N==N2:
  print(n+1)
else:
  print(':(')
Buggy python submission (verdict: Runtime Error):
N=int(imput())
r=N%100
d=int((N-r)/100)

if r>5*d:
  print(0)
else:
  primt(1)

Fixed submission:
N=int(input())
r=N%100
d=int((N-r)/100)
 
if r>5*d:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
w = list(map(int,input().split()))
s = 0
list = []
for i in range(n):
  s += w[i]
for i in range(n):
  t = 0
  for j in range(i):
    t += w[j]
  list.append(abs(s - 2t))
print(min(list))  

Fixed submission:
n = int(input())
w = list(map(int,input().split()))
s = 0
list = []
for i in range(n):
  s += w[i]
for i in range(n):
  t = 0
  for j in range(i):
    t += w[j]
  list.append(abs(s - 2*t))
print(min(list))
Buggy python submission (verdict: Runtime Error):
s = int,(input())
a = s//100
b = s%100

if 1 <= a <= 12:
  if 1 <= b <= 12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if 1 <= b <= 12:
    print("YYMM")
  else:
    print("NA")

Fixed submission:
s = int(input())
a = s//100
b = s%100

if 1 <= a <= 12:
  if 1 <= b <= 12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if 1 <= b <= 12:
    print("YYMM")
  else:
    print("NA")
Buggy python submission (verdict: Runtime Error):
t = [int(input()) for i in range(5)]
t1 = 0
t2 = []
for a in t:
  if a % 10 == 0:
    t1 += a
  else:  
    t1 += (a//10 + 1)*10
    t2.append(a % 10)
print(t1 + min(t2) - 10)

Fixed submission:
t = [int(input()) for i in range(5)]
t1 = 0
t2 = []
for a in t:
  if a % 10 == 0:
    t1 += a
  else:  
    t1 += (a//10 + 1)*10
    t2.append(a % 10)
if t2 == []:
  print(t1)
else:
  print(t1 + min(t2) - 10)
Buggy python submission (verdict: Runtime Error):
s = int(input())
a = [s]

while len(a) - len(set(a)) != 0:
  for i in range(1000000):
    m = i+1
    if a[i] % 2 == 0:
      a.append(int(a[i]/2))
    else:
      a.append(3*a[i] + 1)
      
print(m)

Fixed submission:
s = int(input())
def f(n):
    if n % 2 == 0:
        return int(n/2)
    else:
        return 3*n + 1

def a(i):
    if i == 1:
        return s
    else:
        return f(a(i-1))

list = []
for i in range(1,1000000):
    list.append(a(i))
    if len(list) != len(set(list)):
        print(i)
        break
Buggy python submission (verdict: Runtime Error):
x = input()
x = int(x)
if x = 7 or x = 5 or x = 3:
  print('YES')
else:
  print('NO')

Fixed submission:
x = input()
x = int(x)
if x == 7 or x == 5 or x == 3:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
s = raw_input()
print (s.count("+") - s.count("-"))


Fixed submission:
s = list(input())
n = 0
for i in range(4):
  if s[i] == "+":
    n += 1
  else:
    n -= 1
print(n)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())

if abs(a,c) <= d:
  print("Yes")
elif abs(a,b) <= d and abs(b,c) <= d:
  print("Yes")
else:
  print("No")

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

if abs(a-c) <= d:
  print("Yes")
elif abs(a-b) <= d and abs(b-c) <= d:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
c = [list(input()) for i in range(3)]
s = ""
for j in range(3):
  s += str(c[i][i])
print(s)

Fixed submission:
c = [list(input()) for i in range(3)]
s = ""
for j in range(3):
  s += str(c[j][j])
print(s)

Buggy python submission (verdict: Runtime Error):
c = [list(input()) for i in range(3)]
s = ""
for j in range(3):
  s += c[i][i]
print(s)  


Fixed submission:
c = [list(input()) for i in range(3)]
s = ""
for j in range(3):
  s += str(c[j][j])
print(s)

Buggy python submission (verdict: Runtime Error):
c = [list(input()) for i in range(3)]
s = 0
for j in range(3):
  s += c[i][i]
print(s)  

Fixed submission:
c = [list(input()) for i in range(3)]
s = ""
for j in range(3):
  s += str(c[j][j])
print(s)
Buggy python submission (verdict: Runtime Error):
a , b =input().split()
c = ( a * b ) % 2
if c == 1 :
  print('Odd')
else :
  print('Even')

Fixed submission:
a,b = map( int , input().split() )
c = ( a * b ) % 2

if c == 1 :
  print('Odd')
else :
  print('Even')

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()

n = a * b

if n % 2 == 1 :
  print('Odd')
if n % 2 == 0 :
  print('Even')


Fixed submission:
a,b = map( int , input().split() )
c = ( a * b ) % 2

if c == 1 :
  print('Odd')
else :
  print('Even')

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
n = a * b

if n % 2 == 1 :
  print('Odd')
else :
  print('Even')

Fixed submission:
a,b = map( int , input().split() )
c = ( a * b ) % 2

if c == 1 :
  print('Odd')
else :
  print('Even')
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(map(int,input().split())).sort()
s = 0
for i in range(k):
  s += l[i]
print(s)  

Fixed submission:
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse = True)
s = 0
for i in range(k):
  s += l[i]
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int, input().split())
count = 0
for h in range(0,k+1):
    for i in range(0,k+1):
        for j in range(0,k+1):
            if h + i +  j == s:
                count += 1
print(count)

Fixed submission:
k,s = map(int, input().split())
count = 0
for h in range(0,k+1):
    for i in range(0,k+1):
        if 0 <= s - h - i <= k:
                count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
def main():
    N, M = [int(x) for x in input().split()]
    expected_num_ary = [0] * N

    inputted_digit = []
    for _ in range(M):
        d, v = [int(x) for x in input().split()]
        if d > N:
            print("-1")
            return
        if d in inputted_digit and expected_num_ary[d - 1] != v:
            print("-1")
            return
        if d == 1 and v == 0:
            # 明示的に桁数をズラシに来ているケース
            print("-1")
            return
        expected_num_ary[d - 1] = v if v != 0 else 10
        inputted_digit.append(d)

    num_str = ""
    for num in expected_num_ary:
        num_str += str(num) if num != 10 else "X"

    tester = num_str.lstrip("0").replace("X", "0")

    if tester == "" and N == 1:
        print(0)
    elif N > len(tester):
        print("1%0*d" % (N - 1, int(tester)))
    else:
        print(tester)



if __name__ == '__main__':
    main()


Fixed submission:
def main():
    N, M = [int(x) for x in input().split()]
    expected_num_ary = [1] + [0] * (N - 1)

    if N == 1 and M == 0:
        print("0")
        return

    inputted_digit = []
    for _ in range(M):
        d, v = [int(x) for x in input().split()]
        if d > N:
            print("-1")
            return
        if d in inputted_digit and expected_num_ary[d - 1] != v:
            print("-1")
            return
        if d == 1 and v == 0 and N > 1:
            print("-1")
            return
        expected_num_ary[d - 1] = v
        inputted_digit.append(d)

    num_str = ""
    for num in expected_num_ary:
        num_str += str(num)
    print(num_str)



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, k, q = [int(x) for x in input().split()]

    pts = [k] * n
    ans = []
    for i in range(q):
        answerer = int(input()) - 1
        pts = [x-1 for x in pts]
        pts[answerer] += 1

    for pt in pts:
        print("Yes" if pt > 0 else "No")

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    n, k, q = [int(x) for x in input().split()]

    cleared = [0]*n
    for _ in range(q):
        cleared[int(input()) - 1] += 1

    sum_up = sum(cleared)
    point = [k]*n
    for i in range(n):
        print("Yes" if k + (cleared[i] - sum_up) > 0 else "No")


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
fore, real = input().split()

ct = 0
for i in range(len(fore)):
  if fore[i] == real[i]:
    ct += 1

print(ct)

Fixed submission:
fore = input()
real = input()

ct = 0
for i in range(len(fore)):
  if fore[i] == real[i]:
    ct += 1
 
print(ct)
Buggy python submission (verdict: Runtime Error):
N = int(input())

d = []
for _ in range(N):
  d.append(int(input()))

sm = 0
for i in range(N):
  sm += 1/d

print(1/sm)

Fixed submission:
_ = int(input())
print(1/sum([1/int(x) for x in input().split()]))
Buggy python submission (verdict: Runtime Error):
import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = sc.nextInt();
    int b = asc.nextInt();
    if(n*a>=b){
      System.out.println(b);
    }else{
      System.out.println(n*a);
    }
  }
}

Fixed submission:
elem = input().split(" ")
tx = int(elem[0]) * int(elem[1])
print(tx if tx < int(elem[2]) else int(elem[2]))
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    R, G, B, N = [int(x) for x in input().split()]

    ct = 0
    for r in range(N + 1):
        for g in range(N + 1):
            b = (N-R*r-G*g) / B
            if b < 0: continue
            if (b % 1) == 0:
                ct += 1

    print(ct)

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    R, G, B, N = [int(x) for x in input().split()]

    ct = 0
    for r in range(N + 1):
        for g in range(N + 1):
            b = (N-R*r-G*g) / B
            if b < 0: break
            if (b % 1) == 0:
                ct += 1

    print(ct)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import math

def main():
    a, b, k = [int(x) for x in input().split()]

    p = []
    for i in range(1, max(a, b) - 1):
        if a % i == 0 and b % i == 0:
            print(i)
            p.append(i)

    print(p[len(p) - k])



if __name__ == "__main__":
    main()

Fixed submission:
import math

def main():
    a, b, k = [int(x) for x in input().split()]

    p = []
    for i in range(1, max(a, b) + 1):
        if a % i == 0 and b % i == 0:
            p.append(i)

    print(p[len(p) - k])



if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
print("AB" + ("C" if int(input()) <= 999 else "D"))

Fixed submission:
flag = input()

print(1 * flag.count("+") + -1 * flag.count("-"))

Buggy python submission (verdict: Runtime Error):
print("AB" + ("C" if int(input()) <= 999 else "D"))

Fixed submission:
flag = input()

print(1 * flag.count("+") + -1 * flag.count("-"))
Buggy python submission (verdict: Runtime Error):
alpha = list("abcdefghijklmnopqrstuvwxyz")
s = input()

found = False
for chr in s:
    del alpha[alpha.index(chr)]

if len(alpha) == 0:
    print("None")
else:
    print(alpha[0])


Fixed submission:
alpha = list("abcdefghijklmnopqrstuvwxyz")
s = input()

found = False
for chr in s:
    if chr in alpha:
        del alpha[alpha.index(chr)]

if len(alpha) == 0:
    print("None")
else:
    print(alpha[0])
Buggy python submission (verdict: Runtime Error):
N, K = [int(x) for x in input().split()]
lens = [int(x) for x in input().split()]

lens = sorted(lens).reverse()

if len(lens) >= K:
    print(sum(lens))
else:
    print(sum(lens[:K]))


Fixed submission:
N, K = [int(x) for x in input().split()]
lens = [int(x) for x in input().split()]

lens = sorted(lens)[::-1]

if len(lens) <= K:
    print(sum(lens))
else:
    print(sum(lens[:K]))
Buggy python submission (verdict: Runtime Error):
a, b, c = input().split()
if a + b + c >= 21:
  print("win")
else:
  print("bust")

Fixed submission:
a = map(int, input().split())
if sum(list(a)) <= 21:
  print("win")
else:
  print("bust")
Buggy python submission (verdict: Time Limit Exceeded):


def main():
    n, m = map(int, input().split())

    gate = []

    for _ in range(m):
        ngate = list(map(int, input().split()))
        gate.append(ngate)
    

    result = 0
    for i in range(1, n + 1):
        for j in range(m):
            if gate[j][0] <= i and i <= gate[j][1]:
                if j == len(gate) - 1:
                    result += 1
                continue
            else:
                break

    
    return result


if __name__ == "__main__":
    print(main())

Fixed submission:


def main():
    n, m = map(int, input().split())

    A = []
    B = []

    for _ in range(m):
        a, b = list(map(int, input().split()))
        A.append(a)
        B.append(b)

         
    l = max(A)
    r = min(B)
    #print(l, r)

    if r >= l:
        return r - l + 1
    else:
        return 0

if __name__ == "__main__":
    print(main())



"""
for i in range(1, n + 1):
        for j in range(m):
            if gate[j][0] <= i and i <= gate[j][1]:
                if j == len(gate) - 1:
                    result += 1
                continue
            else:
                break
"""
Buggy python submission (verdict: Runtime Error):
a=map(int,input().split())
sum=a[0]+a[1]+a[2]
print(sum)

Fixed submission:
a=list(map(int, input().split() ) )
#print(a)
s=a[0]+a[1]+a[2]
if s>21:
  print("bust")
else:
  print("win")