Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02772 (python)

Fixed submission:
input()
a = list(map(int, input().split()))
flag = True
for i in a:
  if i % 2 == 0:
    if i%3 != 0 and i%5 != 0:
      flag = False
      break
print('APPROVED' if flag else 'DENIED')

Buggy submission (verdict: Runtime Error):
a = [ int(input()) for i in range(int(input()))]
flag = True
for i in a:
  if i % 2 == 0:
    if i%3 != 0 and i%5 != 0:
      flag = False
      break
print('APPROVED' if flag else 'DENIED')
Problem p02802 (python)

Fixed submission:
n, m = map(int, input().split())
ans_ac = 0
ans_wa = 0
lst = []
for i in range(n):
  lst.append([False, 0])
for i in range(m):
  p, s = input().split()
  p = int(p) - 1
  if lst[p][0]:
    continue
  if s == 'WA':
    lst[p][1] += 1
  else:
    ans_ac += 1
    ans_wa += lst[p][1]
    lst[p][0] = True
print(ans_ac, ans_wa)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ans_ac = 0
ans_wa = 0
dic = {}
for i in range(1, n):
  dic[i] = [False, 0]

for i in range(m):
  p, s = input().split()
  if dic[int(p)][0]:
    continue
  if s == 'WA':
    dic[int(p)][1] += 1
  else:
    ans_ac += 1
    ans_wa += dic[int(p)][1]
    dic[int(p)][0] = True
    
print(ans_ac, ans_wa)
Problem p02806 (python)

Fixed submission:
n = int(input())
lst = []

for i in range(n):
  a, b = input().split()
  b = int(b)
  lst.append([a, b])
x = input()
sum_time = 0
flag = False
for i in lst:
  if flag:
    sum_time += i[1]
  if i[0] == x:
    flag = True
print(sum_time)

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = []

for i in range(n):
  a, b = input().split()
  b = int(b)
  lst.append([a, b])
x = input()
sum_time = 0
flag = false
for i in lst:
  if i[0] == x:
    flag = true
  if flag:
    sum_time += i[1]
print(sum_time)
Problem p03043 (python)

Fixed submission:
n, k = map(int, input().split())
pb = 0
 
for i in range(1, n+1):
  mul = 0
  
  while k > i * (2 ** mul):
    mul += 1
    
  pb += 1/(n*(2**mul))
print(pb)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
pb = 0

for i in range(1, n):
  mul = 0
  
  while k > i * 2** mul:
    mul += 1
    
  pb += (0.5 ** mu) / n
print(pb)
Problem p03068 (python)

Fixed submission:
n = int(input())
a = input()
l = int(input())
for i in range(n):
  if a[l-1] != a[i]:
    print('*', end='')
  else:
    print(a[l-1], end='')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
num = int(input())
lst = [i if i==s[num] else "*" for i in s]
print(*lst, sep='')
Problem p03086 (python)

Fixed submission:
s = input()
lst = ['A', 'G', 'C', 'T']
count = 0
m = 0
for i in s:
  if i in lst:
    count += 1
  else:
    count = 0
  m = max(m, count)
print(m)

Buggy submission (verdict: Runtime Error):
judge = ['A','G', 'C', 'T']
string_list = [i in judge for i in input()]
string = ''.join(string_list).split('False')
print(max([i.count('True') for i in string]))
Problem p03102 (python)

Fixed submission:
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
 
for i in range(n):
  a = list(map(int, input().split()))
  p = c
  for j in range(m):
  	p += a[j] * b[j]
  if 0 < p:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = map(int, input().split())
counter = 0
for i in range(n):
  a = map(int, input().split())
  if sum([b[i]*a[i] for i in range(m)]) + c > 0:
    counter += 1
print(counter)

Buggy submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
 
for i in range(n):
  a = list(map(int, input().split()))
  p = c
  for j in range(m):
  p += a[j] + b[j]
  if 0 < p:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
 
for i in range(n):
  a = list(map(int, input().split()))
  for j in range(m):
    if 0 < a[m] * b[m] + c:
      count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = map(int, input().split())
count = 0
 
for i in range(n):
  a = map(int, input().split())
  for j in range(m):
    if 0 < (a[j] * b[j] + c):
      count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = map(int, input().split())
count = 0
 
for i in range(n):
  a = map(int, input().split())
  for j in range(m):
    if 0 < a[j] * b[j] + c:
      count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = map(int, input().split())
count = 0

for i in range(n):
  a = map(int, input().split())
  for j in range(m):
    if 0 < a[m] * b[m] + c:
      count += 1
print(count)
Problem p03109 (python)

Fixed submission:
print("Heisei" if input()<="2019/04/30" else "TBD")

Buggy submission (verdict: Runtime Error):
n = int(input())
print('Heisei' if n<='2019/4/30' else 'TBD')
Problem p03110 (python)

Fixed submission:
n = int(input())
count = 0
for i in range(n):
  x, y = input().split()
  if y == 'JPY':
    x = int(x)
  else:
    x = float(x) * 3.8e5
  count += x
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
count = 0
for i in range(n):
  x, y = input().split()
  if y == 'JPY':
    x = int(x)
  else:
    x = int(x) * 3.8e5
  count += x
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
count = 0
for i in range(n):
  x, y = input().split()
  if y == 'JPY':
    x = int(x)
  else:
    x = int(x) * 3.8e5
  count += x
print(x)
Problem p03126 (python)

Fixed submission:
n, m = map(int, input().split())
s = set(range(1, m+1))

for i in range(n):
  c, *a = map(int, input().split())
  s &= set(a)
  
print(len(s))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())

lst = list(range(1, m+1)):

for _ in range(n):
  for i in lst:
    if i not in list(map(int, input().split()))[1:]:
      lst.pop(lst.index(i))
print(len(lst))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())

lst = list(range(1, m+1)):

for _ in range(n):
  for i in lst:
    if i not in list(map(int, input().split()))[1:]:
      lst.pop(lst.index(i))
print(len(lst))
Problem p03136 (python)

Fixed submission:
input()
lst = list(map(int, input().split()))
print('Yes' if max(lst) < sum(lst) - max(lst) else 'No')

Buggy submission (verdict: Runtime Error):
input()
lst = map(int, input().split())
print('Yes' if max(lst) < sum(lst) - max(lst) else 'No')
Problem p03239 (python)

Fixed submission:
n, t = map(int, input().split())
m = float('inf')
for i in range(n):
  cost, time = map(int, input().split())
  if time <= t:
    m = min(m, cost)
if m == float('inf'):
  print('TLE')
else:
  print(m)

Buggy submission (verdict: Runtime Error):
n, T = map(int, input().split())
ans = 'TLE'
for i in range(n):
  c, t = map(int, input().split())
  if t <= T:
    ans = min(ans, c)
print(ans)
Problem p03243 (python)

Fixed submission:
a = int(input())
print(a if a % 111 == 0 else 111 * (1 + a // 111))

Buggy submission (verdict: Runtime Error):
n = int(input())
if n//111 = n/111:
  print(n)
else:
  print(((n//111)+1) * 111)
Problem p03292 (python)

Fixed submission:
a = list(map(int, input().split()))
print(max(a) - min(a))

Buggy submission (verdict: Runtime Error):
a = map(int, input().split())
print(max(a) - min(a))

Buggy submission (verdict: Runtime Error):
*a = map(int, input().split())
print(max(a) - min(a))

Buggy submission (verdict: Runtime Error):
a* = map(int, input().split())
print(max(a) - min(a))
Problem p03352 (python)

Fixed submission:
c = 1
a = int(input())
for i in range(1, int(a ** 0.5) + 1):
  for j in range(2, int(a/ 2)):
    if i ** j <= a:
      c = max(c, i**j)
print(c)

Buggy submission (verdict: Runtime Error):
c = 1
import math
a = int(input())
for i in range(1, int(math.sqrt(a))):
  for j in range(2, int(a/2):
    if i ** j <= a:
      c = max(c, i**j)
print(c)
Problem p03378 (python)

Fixed submission:
n, m, x = map(int, input().split())
a = map(int, input().split())
count = 0
for i in a:
  if i < x:
    count += 1
print(min(count, m - count))

Buggy submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
lst = [0] * (n + 1)
for i in map(int,input().split()):
  lst[i] = 1

print(min(sum(lst[:x+1]), sum(lst[x+1:]))
Problem p03386 (python)

Fixed submission:
a, b, k = map(int, input().split())
lst = range(a, b+1)
for i in sorted(set(lst[:k]) | set(lst[-k:])):
  print(i)

Buggy submission (verdict: Runtime Error):
a, b, n = map(int, input().split())
lst = list(range(a, b+1))
if (a + 1 - b) // 2 >= n:
  for i in lst:
    print(i)
else:
  for i in lst[:n+1]:
    print(i)
  for i in lst[-n:]:
    print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
lst = list(range(a, b+1))
for i in sorted(set(lst[:k]) | set(lst[-k:])):
  print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
lst = list(range(a, b+1))
for i in lst:
  if lst.index(i)+1 <= k or len(lst) - lst.index(i)+1 <= k:
    print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
lst = list(range(a, b+1))
print(*(lst[:k]+lst[-k:]), sep='\n')

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
lst = list(range(a, b+1))
print(*lst[:k], *lst[-k:], sep='\n')
Problem p03408 (python)

Fixed submission:
a = [input() for _ in range(int(input()))]
b = [input() for _ in range(int(input()))]
l = list(set(a))
c = max(0, max([a.count(i) - b.count(i) for i in l]))
print(c)

Buggy submission (verdict: Runtime Error):
blue = [input() for i in range(int(input()))]
red = [input() for i in range(int(input()))]
print(max(0, [blue.count(i) - red.count(i) for i in set(blue + red)]))

Buggy submission (verdict: Runtime Error):
a = [input() for _ in range(int(input()))]
b = [input() for _ in range(int(input()))]
print(max(0, max([ a.count(i) - b.count(i) for i in set(a.extend(b))])))

Buggy submission (verdict: Runtime Error):
a = [input() for _ in range(int(input()))]
b = [input() for _ in range(int(input()))]
l = list(set(a))
c = max(0, max[a.count(i) - b.count(i) for i in l])
print(c)

Buggy submission (verdict: Runtime Error):
a = [input() for _ in range(int(input()))]
b = [input() for _ in range(int(input()))]

l = list(set(a))


a = max(0, [a.count(l[i]) - b.count(l[i]) for i in range(len(l))])
print(a)
Problem p03415 (python)

Fixed submission:
s = [input() for i in range(3)]
print(s[0][0] + s[1][1] + s[2][2])

Buggy submission (verdict: Runtime Error):
s = [input() for i in range(3)]
print(s[1][1] + s[2][2] + s[3][3])
Problem p03416 (python)

Fixed submission:
a, b = map(int, input().split())
count = 0
for i in range(a, b+1):
  if str(i) == str(i)[::-1] :
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
count = 0
for i in range(a, b+1):
  if str(i) == str(i).reverse():
    count += 1
print(count)
Problem p03424 (python)

Fixed submission:
n = int(input())
a = set(map(str, input().split()))
print('Three' if len(a) == 3 else 'Four')

Buggy submission (verdict: Runtime Error):
input()
print('Four' if len(set(map(int, input().split()))) else 'Three')
Problem p03434 (python)

Fixed submission:
input()
lst = sorted(list(map(int, input().split())))[::-1]
print(sum(lst[::2]) - sum(lst[1::2]))

Buggy submission (verdict: Runtime Error):
input()
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(s[::2]) - sum(s[1::2]))
Problem p03447 (python)

Fixed submission:
a, b, c = [int(input()) for i in range(3)]
print((a - b) % c)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print((a-b) % c)
Problem p03456 (python)

Fixed submission:
c = int(input().replace(' ', ''))
if c == int(c**0.5) ** 2:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a = int(list(input().split()).join(''))
print('Yes' if int(a**.5) == (a**.5) else 'No')

Buggy submission (verdict: Runtime Error):
a = int(input().split().join(''))
print('Yes' if a == (a**.5)**2 else 'No')
Problem p03457 (python)

Fixed submission:
n = int(input())
s = [0, 0, 0]
ans = 'Yes'
for i in range(n):
  l = list(map(int, input().split()))
  diff_t = l[0] - s[0]
  diff_x = abs(s[1] - l[1])
  diff_y = abs(s[2] - l[2])
  s = [l[0], l[1], l[2]]
  if diff_x + diff_y > diff_t or (diff_t - diff_x - diff_y) % 2 != 0:
    ans = 'No'
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(inupt())
s = [0, 0, 0]

for i in range(n):
  l = list(map(int, input().split()))
  diff_t = l[0] - s[0]
  diff_x = abs(s[1] - l[1])
  diff_y = abs(s[2] - l[2])
  s = [l[0], l[1], l[2]]
  if diff_x + diff_y > diff_t or (diff_t - diff_x - diff_y) % 2 != 0:
    print('No')
    break
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(inupt())
s = [0, 0, 0]

for i in range(n):
  l = map(int, input().split())
  diff_t = l[0] - s[0]
  diff_x = abs(s[1] - l[1])
  diff_y = abs(s[2] - l[2])
  if diff_x + diff_y > diff_t or (diff_t - diff_x - diff_y) % 2 != 0:
    print('No')
    break
else:
  print('Yes')

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

while(True):
  for i in ['dream', 'dreamer', 'erase', 'eraser']:
    if s.endwith(i):
      s = s[:-len(i)]
      break
  else:
    print('NO')
    break
  
  if not s:
    print('YES')
    break
Problem p03473 (python)

Fixed submission:
t = int(input())
print(48 - t)

Buggy submission (verdict: Runtime Error):
a = int(input())
prnt(48 - a)
Problem p03474 (python)

Fixed submission:
a, b = map(int, input().split())
c = input()
print('Yes' if c[a] == '-' and c.count('-') == 1 else 'No')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
c = input()
print('Yes' if c[a] == '-' and c.count('-') == 1 else 'No')
Problem p03486 (python)

Fixed submission:
s, t = [input() for _ in range(2)]
print('Yes' if sorted(s) < sorted(t, reverse=True) else 'No')

Buggy submission (verdict: Runtime Error):
s, t = [input() for _ in range(2)]
jprint('Yes' if sorted(s) < sorted(t, reverse=True) else 'No')
Problem p03494 (python)

Fixed submission:
n = int(input())
a = map(int, input().split())
m = float('inf')
for i in a:
  count = 0
  while i%2 == 0:
    i = i//2
    count += 1
  m = min(m, count)
  if m==0:
    break
print(m)

Buggy submission (verdict: Runtime Error):
count = 0
n = int(input())
lst = [int(input()) for i in range(n)]
while all([i%2 == 0 for i in lst]):
  lst = [i // 2 for i in lst]
  count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = [int(input()) for i in range(n)]
count = 0
while all([i%2 == 0 for i in lst]):
  count += 1
  for j in range(n):
    lst[j] //= 2
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
count = 0
while all[i%2==0 for i in a]:
  a = [i//2 for i in a]
  count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
count = 0
while all[i%2==0 for i in a]:
  a = [i//2 for i in a]
  count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
m = float('inf')
for i in a:
  count = 0
  while i%2 == 0:
    i = i//2
    count += 1
  m = min(m, count)
  if m==0:
    break
print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
eva = float('inf')
for i in a:
  count = 0
  while i%2 == 0:
    i //= 2
    count += 1
  eva = min(count, eva)
print(eva)
Problem p03573 (python)

Fixed submission:
a, b, c = map(int, input().split())
print(a if b==c else b if a==c else c)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(a if b==c else b if a==c else c if a==b)
Problem p03624 (python)

Fixed submission:
s = input()
for i in range(ord('a'), ord('z')+1):
  if chr(i) not in s:
    print(chr(i))
    break
else:
  print('None')

Buggy submission (verdict: Runtime Error):
a = set(map(chr, range(ord(a), ord(z) + 1)))
b = set(input())
print('None' if a==b else sorted(a-b)[0])

Buggy submission (verdict: Runtime Error):
a = set(range(ord(a), ord(z) + 1))
b = set([ord(i) for i in input()])
print('None' if a==b else chr(min(a-b)))

Buggy submission (verdict: Runtime Error):
for i in range(ord('a'), ord('z')+1):
  if chr(i) in s:
    print(chr(i))
    exit()
print('None')

Buggy submission (verdict: Runtime Error):
for i in range(ord('a'), ord('z')+1):
  if chr(i) in s:
    print(chr(i))
    break
else:
  print('None')

Buggy submission (verdict: Runtime Error):
s = input()
for i in range(ord('a'), ord('z')+1):
  if i in s:
    print(i)
    break
else:
  print('None')
Problem p03644 (python)

Fixed submission:
n = int(input())
ans = 1

for i in range(7):
  if n >= 2 ** i:
    ans = 2 ** i
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(7):
  if n < 2 ** i:
    print(2**(i-1))
	break

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(7):
  if n < 2 ** i:
    print(2**(i-1))
	break
Problem p03658 (python)

Fixed submission:
n, k = map(int, input().split())
lst = list(map(int, input().split()))
print(sum(sorted(lst)[::-1][:k]))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
lst = list(map(int, input().split())
print(sum(sorted(lst)[:k])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
lst = [int(input()) for i in range(n)]
print(sum(sorted(lst)[:k])
Problem p03671 (python)

Fixed submission:
lst = sorted(list(map(int, input().split())))
print(sum(lst[:2]))

Buggy submission (verdict: Runtime Error):
lst = list(map(int, input().split()))
print(sum(list[::2]))
Problem p03672 (python)

Fixed submission:
s = list(input().rstrip())
while len(s)>0:
  
  s.pop()
    
  n = len(s)//2
  
  if s[:n] == s[n:] and len(s) % 2 == 0:
    print(len(s))
    break

Buggy submission (verdict: Runtime Error):
s = list(input())
while len(s)>0:
  
  if len(s) % 2 == 0:
    s.pop().pop()
  else:
    s.pop()
    
  n = len(s)//2
  
  if s[:n] == s[n:]:
    print(len(s))
    break

Buggy submission (verdict: Runtime Error):
s = list(input())
while len(s)>0:
  if len(s) % 2 == 0:
    s.pop(-1).pop(-1)
  else:
    s.pop(-1)
  n = len(s)//2
  if s[:n] == s[n-1:]:
    print(len(s))
    break
Problem p03693 (python)

Fixed submission:
a = int(input().rstrip().replace(' ', ''))
print('NO' if a%4 else 'YES')

Buggy submission (verdict: Runtime Error):
a = int(''.join(list(map(int, input().split()))))
print('YES' if a % 4 == 0 else 'NO')

Buggy submission (verdict: Runtime Error):
print('YES' if int(input().replace(' ', '')%4 == 0 else 'NO')
Problem p03711 (python)

Fixed submission:
x, y = map(int, input().split())
a = [4, 6, 9, 11]
b = [1, 3, 5, 7, 8, 10, 12]
if x==y or (x in a and y in a) or (x in b and y in b):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = 'alababaababa'
x, y = map(int, input().split())
print('YES' if s[x] == s[y] else 'NO')
Problem p03730 (python)

Fixed submission:
a, b, c = map(int, input().split())
lst = [(a*i)%b == c for i in range(1, b+1)]
print('YES' if any(lst) else 'NO')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
d = a%b
e = (b+c) % d
print('No' if e else 'Yes')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
cnt = (b+c) % (a%b)
print('No' if cnt else 'Yes')
Problem p03738 (python)

Fixed submission:
a, b = [int(input()) for _ in range(2)]
print('GREATER' if a>b else 'EQUAL' if a==b else 'LESS')

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print('GREATER' if a>b else 'EQUAL' if a==b else 'LESS' if a<b)
Problem p03760 (python)

Fixed submission:
o, e = [input().rstrip() for i in range(2)]
lst = []
for i in range(len(o)):
    print(o[i], end='')

    if i + 1 > len(e):
        print()
        break
    else:
        print(e[i], end='')

Buggy submission (verdict: Runtime Error):
o = list(input())
e = list(input()) + ''

for s, t in zip(o, e):
  print(s, t, sep='', end='')

Buggy submission (verdict: Runtime Error):
o = list(input())
e = list(input())
if len(o) > len(e):
  e.append("")

for i in range(o):
  print(o[i] + e[i], end='')

Buggy submission (verdict: Runtime Error):
o = list(input())
e = list(input())
if len(o) > len(e):
  e.add("")
for i in range(o):
  print(o[i] + e[i], end='')

Buggy submission (verdict: Runtime Error):
o, e = [input().rstrip() for i in range(2)]
lst = []
for i in len(o):
    print(o[i], end='')

    if i + 1 > len(e):
        print()
        break
    else:
        print(e[i], end='')
Problem p03998 (python)

Fixed submission:
S = {i: list(input()) for i in 'abc'}
s = 'a'
while S[s]:
  s = S[s].pop(0)
print(s.upper())

Buggy submission (verdict: Runtime Error):
dic = {i:list(input()) for i in 'abc'}
key = 'a'
while len(dic[key]) != 0:
  key = dic.pop(0)
print(key.upper())

Buggy submission (verdict: Runtime Error):
dic = {i:list(input()) for i in 'abc'}
key = 'a'
while len(dic[key]) != 0:
  key = dic.pop(key)
print(key.upper())

Buggy submission (verdict: Runtime Error):
dic = {i:list(input()) for i in 'abc'}
while len(dic[key]) != 0:
  key = 'a'
  key = dic.pop(key)
print(key.upper())

Buggy submission (verdict: Runtime Error):
S = {i: input() for i in 'abc'}
s = 'a'
while S[s]:
  s = S[s].pop(0)
print(s)
Problem p04030 (python)

Fixed submission:
s = input()
count = ''
for i in s:
  if i == 'B':
    if len(count) != 0:
    	count = count[:-1]
  else:
    count += i
print(count)

Buggy submission (verdict: Runtime Error):
t = ""
s = input()
for i in s:
  if i == 'B' and len(t) > 0:
    t.pop()
  else:
    t.append(i)
print(t)
Problem p04044 (python)

Fixed submission:
n, l = map(int, input().split())
s = [input().rstrip() for i in range(n)]
print(''.join(sorted(s)))

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
a = sorted([input() for i in range(n)])
print("".join(s))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
lists = []
for i in range(a):
  lists.add(input())

print(lists.sort.join(''))

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
lst = [sorted(input()) for _ in range(n)]
print(''.join(sorted(lst)))
Problem p02632 (python)

Fixed submission:
MAXN = 2*10**6+2
p = 10**9 + 7

fact = [1] * MAXN
invfact = [1] * MAXN
for i in range(1, MAXN):
    fact[i] = fact[i-1] * i % p
invfact[MAXN-1] = pow(fact[MAXN-1], p-2, p)
for i in range(MAXN-1, 0, -1):
    invfact[i-1] = invfact[i] * i % p
    
def nCk(n, k):
    return fact[n] * invfact[n-k] * invfact[k] % p

K = int(input())
N = len(input())

ans = 0
for i in range(N, N+K+1):
    ans += pow(25, i-N, p) * nCk(i-1, N-1) * pow(26, N+K-i, p) % p
    ans %= p
print(ans)

Buggy submission (verdict: Runtime Error):
MAXN = 10**6+1
p = 10**9 + 7

fact = [1] * MAXN
invfact = [1] * MAXN
for i in range(1, MAXN):
    fact[i] = fact[i-1] * i % p
invfact[MAXN-1] = pow(fact[MAXN-1], p-2, p)
for i in range(MAXN-1, 0, -1):
    invfact[i-1] = invfact[i] * i % p
    
def nCk(n, k):
    return fact[n] * invfact[n-k] * invfact[k] % p

K = int(input())
N = len(input())

ans = 0
for i in range(N, N+K+1):
    ans += pow(25, i-N, p) * nCk(i-1, N-1) * pow(26, N+K-i, p) % p
    ans %= p
print(ans)