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

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N,S = read().decode('utf-8').split()
count = 0
for i in range(1000):
  s = str(i).zfill(3)
  index_all = 0
  for j in range(3):
    index = S[index_all:].find(s[j])
    if index == -1:
      break
    index_all += index+1
    if j ==2:
      count += 1
print(count)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N,S = read().decode('utf-8').split()
print(N,S)
count = 0
for i in range(1000):
  s = str(i).zfill(3)
  index_all = 0
  for j in range(3):
    index = S[index_all:].find(s[j])
    if index == -1:
      break
    index_all += index+1
    if j ==2:
      count += 1
print(count)import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N,S = read().decode('utf-8').split()
count = 0
for i in range(1000):
  s = str(i).zfill(3)
  index_all = 0
  for j in range(3):
    index = S[index_all:].find(s[j])
    if index == -1:
      break
    index_all += index+1
    if j ==2:
      count += 1
print(count)
Problem p03436 (python)

Fixed submission:
import sys
from collections import deque
H,W=map(int,input().split())
map = [[i for i in map(str,sys.stdin.readline().rstrip())] for _ in range(H)]
count_dot = 0
dist = [[0]*W for _ in range(H)]
for i in range(H):
  for j in range(W):
    if map[i][j] == '.':
      count_dot +=1
def bfs():
  while q:
    x,y = q.popleft()
    if x == H-1 and y ==W-1:
      break
    dx = [0,1,0,-1]
    dy = [1,0,-1,0]
    for i in range(4):
      nx = x + dx[i]
      ny = y + dy[i]
      if 0 <= nx < H and 0 <= ny < W and map[nx][ny]=='.' and dist[nx][ny] == 0:
        q.append((nx,ny))
        dist[nx][ny] = dist[x][y] + 1
q = deque()
q.append((0,0))
bfs()
dist_min = dist[H-1][W-1]
if dist_min ==0:
  print(-1)
else:
  print(count_dot-dist_min-1)

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque
H,W=map(int,input().split())
map = [[i for i in map(str,sys.stdin.readline().rstrip())] for _ in range(H)]
count_dot = 0
dist = [[0]*W for _ in range(H)]
for i in range(H):
  for j in range(W):
    if map[i][j] == '.':
      count_dot +=1
def bfs():
  while True:
    x,y = q.popleft()
    if x == H-1 and y ==W-1:
      break
    dx = [0,1,0,-1]
    dy = [1,0,-1,0]
    for i in range(4):
      nx = x + dx[i]
      ny = y + dy[i]
      if 0 <= nx < H and 0 <= ny < W and map[nx][ny]=='.' and dist[nx][ny] == 0:
        q.append((nx,ny))
        dist[nx][ny] = dist[x][y] + 1
q = deque()
q.append((0,0))
bfs()
dist_min = dist[H-1][W-1]
if dist_min ==0:
  print(-1)
else:
  print(count_dot-dist_min-1)

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque
H,W=map(int,input().split())
map = [[i for i in map(str,sys.stdin.readline().rstrip())] for _ in range(H)]
count_dot = 0
dist = [[0]*W for _ in range(H)]
for i in range(H):
  for j in range(W):
    if map[i][j] == '.':
      count_dot +=1
def bfs():
  while True:
    x,y = q.popleft()
    if x == H-1 and y ==W-1:
      break
    dx = [0,1,0,-1]
    dy = [1,0,-1,0]
    for i in range(4):
      nx = x + dx[i]
      ny = y + dy[i]
      if 0 <= nx < H and 0 <= ny < W and map[nx][ny]=='.' and dist[nx][ny] == 0:
        q.append((nx,ny))
        dist[nx][ny] = dist[x][y] + 1
q = deque()
q.append((0,0))
bfs()
dist_min = dist[H-1][W-1]
print(count_dot-dist_min-1)
Problem p02718 (python)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
if sum(x >= sum(a)/(4*m) for x in a) >= m:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
for x in a:
  if x >= sum(a)/(4*m):
  	res += x

if res >= m:
  print('Yes')
else:
  print('No')
Problem p02742 (python)

Fixed submission:
a,b=map(int,input().split())
if a==1 or b == 1:
  print(1)
else:
  print((a*b+1)//2)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print((ab+1)//2)
Problem p02801 (python)

Fixed submission:
m = input()
print(chr(ord(m)+1))

Buggy submission (verdict: Runtime Error):
m = input()
print(chr(rd(m)+1))
Problem p02818 (python)

Fixed submission:
a, b, k = map(int, input().split())
if a+b < k:
  print('0 0')
elif a < k:
  print('{} {}'.format(0, a+b-k))
else:
  print('{} {}'.format(a-k, b))

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
if a+b < k:
  print('0 0')
elif a < k:
  print('{} {}'.format(0, a+b-k))
elif:
  print('{} {}'.format(a-k, b))
Problem p02848 (python)

Fixed submission:
import string
n = int(input())
s = input()
for c in s:
  print(string.ascii_uppercase[(ord(c)-ord('A')+n)%26], end='')
print()

Buggy submission (verdict: Runtime Error):
import string
n = int(input())
s = input()
for c in s:
  print(string.ascii_uppercase[(ord(c)-ord('A')+n)%26)], end='')
print()
Problem p03323 (python)

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


if a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")

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


if a <= (a+b)//2 and b <= (a+b)//2:
    print("Yay!")
else:
    print(":(")
Problem p03352 (python)

Fixed submission:
import math
x = int(input())

a = []
b = []
for i in range(8):
    a.append(math.floor(math.pow(x,(1.0/(i+2)))))

for i in range(8):
    b.append(math.pow(a[i],(i+2)))
tmp = 0
for i in range(8):
    if tmp < b[i]:
        tmp = b[i]
if x != 1000:
    print(math.floor(tmp))
else:
    print(1000)

Buggy submission (verdict: Runtime Error):
import math
x = int(input())


lst = []
for i in range(31):
    for j in range(8):
        if math.pow(i+1,j+1) <= 1000:
            lst.append(math.pow(i+1,j+1))
        else:
            break
l=999
for i in range(len(lst)):
    if 0 < x-lst[i] < l :
        l = abs(x-lst[i])
        ans = lst[i]


print(math.floor(ans))

Buggy submission (verdict: Runtime Error):
import math
x = int(input())


lst = []
for i in range(31):
    for j in range(8):
        if math.pow(i+1,j+1) <= 1000:
            lst.append(math.pow(i+1,j+1))
        else:
            break
print(lst)
l=999
for i in range(len(lst)):
    if 0 < x-lst[i] < l :
        l = abs(x-lst[i])
        ans = lst[i]


print(math.floor(ans))
Problem p03360 (python)

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

for i in range(k):
    s += max(a,b,c)
    if max(a,b,c) == a:
        a*=2
    elif max(a,b,c) == b:
        b*=2
    else:
        c*=2        
print(s)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
k = int(input())
s = a+b+c

for i in range(k):
    s += max(a+b+c)

print(s)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
k = int(input())
s = a+b+c
for i in range(k):
    aa += a
    bb += b
    cc += c

print(max(aa,bb,cc))
Problem p03408 (python)

Fixed submission:
n = int(input())
blue = [input() for i in range(n)]
m = int(input())
red = [input() for i in range(m)]
x = 0
for w in set(blue):
    tmp = blue.count(w) - red.count(w)
    if tmp > x:
        x = tmp
print(x)

Buggy submission (verdict: Runtime Error):
n = int(input())
blue = [input() for i in range(n)]
m = int(input())
red = [input() for i in range(n)]
x = 0
for w in set(blue):
    x = blue.count(w) - red.count(w) if blue.count(w) - red.count(w) > x else pass
print(x)
Problem p03417 (python)

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

if n == 1 and m != 1:
    print(m-2)
elif m == 1 and n != 1:
    print(n-2)
elif n == 1 and m == 1:
    print(1)
else:
    print((m-2)*(n-2))

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

if n == 1:
    print(m-2)
else if m == 1:
    print(n-2)
else :
    print((m-2)*(n-2))
Problem p03563 (python)

Fixed submission:
r = int(input())
g = int(input())

print(2*g - r)

Buggy submission (verdict: Runtime Error):
r = int(input())
g = int(input())

print(2g - r)
Problem p03643 (python)

Fixed submission:
n = int(input())

print("ABC" + str(n))

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

print("ABC" + n)
Problem p03644 (python)

Fixed submission:
n = int(input())
lst = [1,2,4,8,16,32,64,128]

for i in range(len(lst)):
    if n < lst[i]:
        print(lst[i-1])
        break

Buggy submission (verdict: Runtime Error):
n = int(input())
list = {1,2,4,8,16,32,64}

for i in range(7):
    if n <= list[i]:
        print(list[i-1])
        break
Problem p03760 (python)

Fixed submission:
o = input()
e = input()

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


if len(o) != len(e):
    print(o[-1])

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

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

if len(o) != len(e):
    print(o[len(o)-1])

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

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

if len(o) != len(e):
    print(o[len(o)])
Problem p03826 (python)

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

if a*b >= c*d:
    print(a*b)
else:
    print(c*d)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input())

if(a*b >= c*d):
    print(a*b)
else:
    print(c*d)
Problem p04033 (python)

Fixed submission:
a, b = map(int, input().split())
nega_cnt = 0
is_zero = False
if a * b < 0:
        print("Zero")
        is_zero = True
elif b < 0 and (a-b) % 2 == 0:
        print("Negative")
else:
        print("Positive")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
nega_cnt = 0
is_zero = False
for x in range(a, b+1):
        if x < 0:
                nega_cnt += 1

        elif x == 0:
                print("Zero")
                is_zero = True

if not is_zero:

        if nega_cnt % 2 == 1:
                print("Negative")
        else:
                print("Positive")
~                                                                                                  ~                                                                                                  ~                                                                                                  ~                                                                                                  ~                                                                                                  ~                                                                                                  ~                                                                                                  ~                                                                                                  ~                                                                                                  ~
Problem p02684 (python)

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))

dic = {}
for i, v in enumerate(A):
    dic[i+1] = v

town = 1
s = set()
l = []
for _ in range(K):
    l.append(town)
    s.add(town)
    town = dic[town]
    if town in s:
        stop_twon = town
        break
if N <= K:
    list_first_split = l[:l.index(stop_twon)]
    list_second_split = l[l.index(stop_twon):]
    print(list_second_split[(K - (len(list_first_split))) % len(list_second_split)])
else:
    print(town)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))

dic = {}
for i, v in enumerate(A):
    dic[i+1] = v

town = 1
s = set()
l = []
for _ in range(K):
    l.append(town)
    s.add(town)
    town = dic[town]
    if town in s:
        stop_twon = town
        break

list_first_split = l[:l.index(stop_twon)]
list_second_split = l[l.index(stop_twon):]
print(list_second_split[(K - (len(list_first_split))) % len(list_second_split)])
Problem p02911 (python)

Fixed submission:
import collections

N,K,Q = map(int,input().split())
A = [int(input()) for i in range(Q)]
c = collections.Counter(A)

if (K - Q) > 0:
    for _ in range(N):
        print('Yes')
else:
    l = ['No'] * N
    for i,v in dict(c).items():
        if v >(Q - K):
            l[i-1] = 'Yes'
    for j in l:
        print(j)

Buggy submission (verdict: Runtime Error):
# import collections

# N,K,Q = map(int,input().split())
# A = [int(input()) for i in range(Q)]
# c = collections.Counter(A)

if (K - Q) > 0:
    for _ in range(N):
        print('Yes')
else:
    l = []
    for i,v in dict(c).items():
        if v >(Q - K):
            l.append(i-1)
    l.sort()
    for j in range(N):
        if j in l:
            print('Yes')
            l.pop(0)
            if l == []:
                for _ in range(N-j-1):
                    print('No')
                break
        else:
            print('No')

Buggy submission (verdict: Runtime Error):
# import collections

# N,K,Q = map(int,input().split())
# A = [int(input()) for i in range(Q)]
# c = collections.Counter(A)

if (K - Q) > 0:
    for _ in range(N):
        print('Yes')
else:
    l = []
    for i,v in sorted(dict(c).items(),reverse = True, key=lambda x:x[1]):
        if v >(Q - K):
            l.append(i-1)
        else:
            break
    for j in range(N):
        if j in l:
            print('Yes')
            l.pop() 
        else:
            print('No')

Buggy submission (verdict: Runtime Error):
test
Problem p03627 (python)

Fixed submission:
import collections
n = int(input())
alist = list(map(int,input().split()))
adic = collections.Counter(alist)
A = [0,0]
for i in adic:
  if adic[i] > 1:
    A.append(i)
  if adic[i] > 3:
    A.append(i)
sortedA = sorted(A)
print(sortedA[-1]*sortedA[-2])

Buggy submission (verdict: Runtime Error):
import collections
n = int(input())
alist = list(int,input().split())
adic = collections.Counter(alist)
for k,v in adic.items():
  if v == 1:
    del(dic[k])
sort_adic = sorted(adic.items(), reverse = True, key = lamda x:x[1])
li = list(sort_adic.items())
print(li[0][1]*li[1][1])
Problem p03636 (python)

Fixed submission:
s = input()
print(s[0] + str(len(s)-2) + s[-1])

Buggy submission (verdict: Runtime Error):
s = input()
print(s[0]+(len(s)-1)+s[-1])
Problem p03643 (python)

Fixed submission:
n = input()
print("ABC"+n)

Buggy submission (verdict: Runtime Error):
n=int(input())
print("ABC"+int(n))

Buggy submission (verdict: Runtime Error):
n = int(input())
print("ABC"+n)
Problem p03644 (python)

Fixed submission:
n = int(input())
ans = 0
for i in range(8):
  if 2**i <= n:
    ans=2**i
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
  if i = 2**a and 2**a < n and n < 2**(a+1):
    print(i)
Problem p03645 (python)

Fixed submission:
n,m = map(int,input().split())
X = [list(map(int,input().split())) for i in range(m)]
a_list = []
b_list = []
for i in range(m):
  if X[i][0] == 1:
    a_list.append(X[i][1])
  elif X[i][1] == n:
    b_list.append(X[i][0])
c_set = set(a_list) & set(b_list)
if len(c_set) ==0:
  print("IMPOSSIBLE")
else:
  print("POSSIBLE")

Buggy submission (verdict: Runtime Error):
a_list = []
b_list = []
for i in range(m):
  if X[i][0] == 1:
    a_list.append(X[i][1])
  elif X[i][1] == 1:
    a_list.append(X[i][0])
  elif X[i][0] == n:
    b_list.append(X[i][1])
  elif X[i][1] == n:
    b_list.append(X[i][0])
c_set = set(a_list) & set(b_list)
if len(c_set) ==0:
  print("IMPOSSIBLE")
else:
  print("POSSIBLE")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
X = [list(map(int,input().split())) for i in range(m)]
a_list = []
b_list = []
for i in range(m):
  if X[i][0] == 1:
    a_list.append(X[i][1])
  elif X[i][1] == 1:
    a_list.append(X[i][0])
  elif X[i][0] == n:
    b_list.append(X[i][1])
  elif X[i][1] == n:
    b_list.append(X[i][0])
c_set = set(a_list)&set(b_list)
if len(c_set) ==0:
  print("IMPOSSIBLE")
else:

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
X = [list(map(int,input().split())) for i in range(m)]
a_list = []
b_list = []
for i in range(m):
  if X[i][0] == 1:
    a_list.append(X[i][1])
  elif X[i][1] == 1:
    a_list.append(X[i][0])
  elif X[i][0] == n:
    b_list.append(X[i][1])
  elif X[i][1] == n:
    b_list.append(X[i][0])
c_dic = {a_list}&{b_list}
if len(c_dic) ==0:
  print("IMPOSSIBLE")
else:
  print("POSSIBLE")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
X = [list(map(int,input().split())) for i in range(m)]
a_list = []
b_list = []
for i in range(m):
  if X[i][0] = 1:
    a_list.append(X[i][1])
  elif X[i][1] = 1:
    a_list.append(X[i][0])
  elif X[i][0] = n:
    b_list.append(X[i][1])
  elif X[i][1] = n:
    b_list.append(X[i][0])
c_dic = {a_list}&{b_list}
if len(c_dic) ==0:
  print("IMPOSSIBLE")
else:
  print("POSSIBLE")
Problem p03657 (python)

Fixed submission:
a,b=map(int,input().split())
if a*b*(a+b)%3==0:
  print("Possible")
else:
  print("Impossible")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a%3==0 \or b%==0 \or (a+b)%3==0:
  print("Possible")
else:
  print("Impossible")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a%3==0 or\ b%==0 or\ (a+b)%3==0:
  print("Possible")
else:
  print("Impossible")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a%3==0 or b%==0 or(a+b)%3==0:
  print("Possible")
else:
  print("Impossible")
Problem p03672 (python)

Fixed submission:
n = input()
num = len(n)-2
for i in range(num,0,-2):
  f = int(i/2)
  if n[:f]==n[f:i]:
    print(i)
    break

Buggy submission (verdict: Runtime Error):
n = input()
num = len(n)-2
for i in range(num,0,-2):
  f = int(i/2)
  if s[:f]==s[f:i]:
    print(i)
    break

Buggy submission (verdict: Runtime Error):
n = input()
num = len(s)-2
for i in range(num,0,2):
  f = int(i/2)
  if s[:f]==s[f:i]:
    print(i)
    break

Buggy submission (verdict: Runtime Error):
a = [list(map(str(input().split())))]
while True:
  h = int(len(a)/2)
  for i in range(h-1):
    if all(a[i]==a[i+h]):
      print(len(a))
      exit()
  a[:-1]

Buggy submission (verdict: Runtime Error):
a = str(input())
while True:
  h = int(len(a)/2)
  for i in range(h-1):
    if all(a[i]==a[i+h]):
      print(len(a))
      exit()
  a.pop(-1)

Buggy submission (verdict: Runtime Error):
a = str(input())
while True:
  for i in range(len(a)//2):
    if all(a[i]==a[i+(len(a)//2)]):
      print(len(a))
      exit()
  a.pop(-1)
Problem p03673 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
if n % 2 == 0:
  a = l[::-2]+ l[0::2]
else:
  a = l[::-2]+ l[1::2]
print(*a)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
a = [l[0]]
if n % 2 ==1:
  for i in range(1,n):
    if i % 2 == 1:
      a.insert(0,l[i])
    else:
      a.append(l[i])
else:
  for i in range(1,n):
    if i % 2 == 1:
      a.appen(l[i])
    else:
      a.insert(0,l[i])
print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
a = []
for i in range(n):
  a.append(l[i])
  a = a[::-1]
pritn(a)
Problem p03711 (python)

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

Buggy submission (verdict: Runtime Error):
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]
x,y=input().split()
if x,y is in a or x,y is in b:
  print("Yes")
else:
  print("No")
Problem p03759 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a-b = b-c:
  print("YES")
else:
  print("NO")
Problem p03760 (python)

Fixed submission:
a = list(input())
b = list(input())+[""]
for x,y in zip(a,b):
  print(x+y, end = "")

Buggy submission (verdict: Runtime Error):
a = list(input())
b = list(input())
for x,y zip(a,b):
  print(x+y, end = "")

Buggy submission (verdict: Runtime Error):
a = list(input())
b = list(input())+""
print(x+y for x,y in zip(a,b).end="")

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
print(''.join([a[i]+b[i] for i in range(o,max(len(a),len(b)))]))
Problem p03761 (python)

Fixed submission:
from collections import Counter
n=int(input())
s=Counter(input())
for i in range(n-1):
    s&=Counter(input())
print("".join(sorted(s.elements())))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
A = Counter(input())
B = Counter(input())
C = Counter(input())
D = A & B
E = D & C
print("".join(sorted(E.elements())))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
A = Counter(input())
B = Counter(input())
C = Counter(input())
ans = ""
for key,value in A.items():
  ans.append(str(key)*min(value,B[key],C[key]))
print(sorted(ans))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
A = Counter(list(input()))
B = Counter(list(input()))
C = Counter(list(input()))
ans = []
for key,value in A.items():
  ans.append(key*min(value,B[key],C[key]))
print(join(sorted(ans)),end="")

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
A = Counter(list(input()))
B = Counter(list(input()))
C = Counter(list(input()))
ans = []
for key,value in A.items():
  ans.append(str(key)*min(value,B[key],C[key]))
print(join(sorted(ans)),end="")

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
A = Counter(list(input()))
B = Counter(list(input()))
C = Counter(list(input()))
ans = ""
for key,value in A.items():
  ans.append(str(key)*min(value,B[key],C[key]))
print(sorted(ans))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
A = Counter(list(map(input().split())))
B = Counter(list(map(input().split())))
C = Counter(list(map(input().split())))
ans = ""
for key,value in A.items():
  ans.append(str(key)*min(value,B[key],C[key]))
print(sorted(ans))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
A = Counter(input().split())
B = Counter(input().split())
C = Counter(input().split())
ans = ""
for key,value in A.items():
  ans.append(str(key)*min(value,B[key],C[key]))
print(sorted(ans))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
A = sorted(Counter(input().split()))
B = sorted(Counter(input().split()))
C = sorted(Counter(input().split()))
ans = ""
for key,value in A.items():
  ans.append(key*min(value,B[key],C[key]))
print(ans)
Problem p03777 (python)

Fixed submission:
a,b=input().split()
print("H" if a==b else"D")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
print("H" if a=b="H"or a=b="D" else"D")
Problem p03844 (python)

Fixed submission:
print(eval(input()))

Buggy submission (verdict: Runtime Error):
print(eval(input())
Problem p03852 (python)

Fixed submission:
n = str(input())
if n == "a" or n =="i" or n =="u" or n =="e" or n =="o":
  print("vowel")
else:
  print("consonant")

Buggy submission (verdict: Runtime Error):
n = str(input())
if n = "a" or "i" or "u" or "e" or "o":
  print("vowe")
else:
  print("consonant")
Problem p03943 (python)

Fixed submission:
x = list(map(int,input().split()))
y = sorted(x)
if y[0]+y[1]==y[2]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x = list(map(int,input().split()))
y = sorted(x)
if y[0]+y[1]=y[2]:
  print("Yes")
else:
  print("No")
Problem p03945 (python)

Fixed submission:
from itertools import groupby
print(len(list(groupby(input())))-1)

Buggy submission (verdict: Runtime Error):
n = input()
gr = itertools.groupby(n)
print(len(gr)-1)
Problem p03999 (python)

Fixed submission:
S = input()
n = len(S)
ans = 0
for i in range(n):
  a = int(S[i])
  for j in range(n-i):
    ans += a * 10**j * 2**i * 2**(max(0,n-i-j-2))
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
l = len(n)
ans = 0
for i in range(l):
  for j in range(l-i):
    ans+=int(n[i]) * 10**j * 2**i * 2**(n-i-j-2)
print(ans)
Problem p04011 (python)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n >= k:
  print(k*x+(n-k)*y)
else:
  print(n*x)

Buggy submission (verdict: Runtime Error):
N,K,X,Y=input().split()
print((K*X+(N-K)*Y) if N>=K else N*X)