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

Fixed submission:
N=int(input());A=input().split();v=[int(i)%4 for i in A];print('Yes' if v.count(0)+v.count(2)//2>=N//2 else 'No')

Buggy submission (verdict: Runtime Error):
N=int(input());A=input();v=[int(i)%4for i in A[::2]];print('Yes'if v.count(0)+v.count(2)//2>=N//2 else'No')

Buggy submission (verdict: Runtime Error):
N=int(input());A=input();v=[int(i)%4for i in A];print('Yes'if v.count(0)+v.count(2)//2>=N//2 else'No')
Problem p03657 (python)

Fixed submission:
a,b=map(int,input().split())
print(['Impossible','Possible'][a%3==0 or b%3==0 or (a+b)%3==0])

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(['Impossible','Possible'][a%3==0 or b%3==0 or (a+b)%3==0])

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(['Impossible','Possible'][a%3==0 or b%3==0 or (a+b)%3==0])
Problem p03679 (python)

Fixed submission:
x,a,b=map(int,input().split())
print('delicious' if b-a<=0 else 'dangerous' if x<b-a else 'safe')

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
print('delicious' if 0<b-a else 'dangerous' x>b-a else 'safe')
Problem p03777 (python)

Fixed submission:
x=input().replace(' ','')
print('H' if x=='HH' or x=='DD' else 'D')

Buggy submission (verdict: Runtime Error):
x=input().split().replace(' ','')
print('H' if x=='HH' or x=='DD' else 'D')
Problem p03796 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
N=int(input())
MOD=10**9+7
def seki(x):
	if x<2:
		return 1
	else:
		return x*seki(x-1)%MOD
print(seki(N)%MOD)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**5)
N=int(input())
MOD=10**9+7
def seki(x):
	if x<2:
		return 1
	else:
		return x*seki(x-1)%MOD
print(seki(N)%MOD)
Problem p03827 (python)

Fixed submission:
N=int(input())
S=input()
arr=[]
v=0
for s in S:
	if s=="I":
		v+=1
		arr.append(v)
	else:
		v-=1
		arr.append(v)
print(max(0,max(arr)))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
arr=[]
v=0
for s in S:
	if s=="I":
		v+=1
		arr.append(v)
	else:
		v-=1
		arr.append(v)
print(max(0,arr))
Problem p03861 (python)

Fixed submission:
a,b,x=map(int,input().split())
print(b//x-(a-1)//x)

Buggy submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
print(b//x-a//a+1)
Problem p03943 (python)

Fixed submission:
a,b,c=map(int,input().split())
print('Yes' if a==(b+c) or b==(a+c) or c==(a+b) else 'No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print('YES' if a=b+c or b=a+c or c=a+b else 'NO')
Problem p04011 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
k=int(input())
x=int(input())
y=int(input())
print(int(x*k+y*(n-k)*(n>k))
Problem p04012 (python)

Fixed submission:
w=input()
arr=[]
for i in set(w):
    arr.append(w.count(i)%2==0)
print("Yes" if all(arr) else "No")

Buggy submission (verdict: Runtime Error):
w=input()
arr=[]
for i in set(s):
    arr.append(s.count(i)%2==0)
print(all(arr))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# coding=utf-8
w=input()
arr=[]
for i in set(s):
    arr.append(s.count(i)%2==0)
print(all(arr))
Problem p04029 (python)

Fixed submission:
print(sum(range(1,int(input())+1)))

Buggy submission (verdict: Runtime Error):
print(sum(range(1,int(input())+1))
Problem p04044 (python)

Fixed submission:
N,L=map(int,input().split())
print("".join(sorted([input() for _ in range(N)])))

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
S=[input() for _ in range(N)]
arr=[]
for i in range(N):
	for j in range(N):
		for k in range(N):
			if i!=j and j!=k and i!=k:
				arr.append(S[i]+S[j]+S[k])
print(sorted(arr)[0])

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
S=[input() for _ in range(N)]
arr=[]
for i in range(N):
	for j in range(N):
		for k in range(N):
			if i!=j and j!=k:
				arr.append(S[i]+S[j]+S[k])
print(sorted(arr)[0])
Problem p02675 (python)

Fixed submission:
n = int(input())
if n%10 in [2, 4, 5, 7, 9]:
    print("hon")
elif n%10 in [0, 1, 6, 8]:
    print("pon")
else:
    print("bon")

Buggy submission (verdict: Runtime Error):
n = int(input())
if n%10 in [2, 4, 5, 7, 9]:
  print("hon")
 elif n%10 in [0, 1, 6, 8]:
  print("pon")
 else:
  print("bon")
Problem p02621 (python)

Fixed submission:
a = int(input())
print(a+a**2+a**3)

Buggy submission (verdict: Runtime Error):
a = input()
print(a + a**2 +a**3)

Buggy submission (verdict: Runtime Error):
a = int(input())
  if 1<=a<=10: 
    b = a + a**2 + a**3
    print(b)
Problem p02628 (python)

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

print(sum(sorted(p)[:K]))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
p = list(map(int,input().split())
p.sort()
print(sum(p[:K]))

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

print(sum(sorted(p)[:K]
Problem p02687 (python)

Fixed submission:
s = input()
if s == "ABC":
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
s = input()
if s == "ABC": print("ARC")
else print("ABC")
Problem p03160 (python)

Fixed submission:
n = int(input())
vals = list(map(int, input().split()))
dp = [0] * n

dp[0] = 0 
dp[1] = abs(vals[0] - vals[1])

for i in range(2,n):
    dp[i] = min( dp[i-1] + abs(vals[i] - vals[i-1]), \
            dp[i-2] + abs(vals[i] - vals[i-2]))

print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
vals = [*map(int, input().split())]
dp = [0] * n

dp[0] = 0 
dp[1] = abs(vals[0] - vals[1])

for i in range(2,n):
    dp[i] = min( dp[i-1] + abs(vals[i] - vals[i-1]), \
            dp[i-2] + abs(vals[i] - vals[i-2]))

print(dp[n-1])
Problem p02783 (python)

Fixed submission:
H, A = map(int, input().split())

if (H % A):
    print((H//A)+1)
else:
    print(H//A)

Buggy submission (verdict: Runtime Error):
from math import seil

H, A = map(int, input().split())
print(ceil(H/A))
Problem p02789 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = input().split()
print("Yes" if (a==b) else "No)
Problem p02910 (python)

Fixed submission:
S = input()
s1 = S[1::2]
s2 = S[::2]


if "L" in s2 or "R" in s1:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
S = input()
is_easy = False
for i in range(len(S)):
  if i % 2 == 0:
   	if S[i] == "R":
      print("No")
      is_easy = True
      break
  else:
   	if S[i] == "L":
      print("No")
      is_easy = True
      break
      
if not is_diff:
  print("Yes")
Problem p02983 (python)

Fixed submission:
L, R = map(int, input().split())

z = 2019

if R-L>= 2019:
    print(0)
else:
    for l in range(L,R):
        for r in range(l+1, R+1):
            z = min(z, ((l % 2019) * (r % 2019)) % 2019)
    print(z)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())


if R-L>=L:
    print(0)
else:
    for l in range(L,R):
        for r in range(l+1, R+1):
            z = min(z, ((l % 2019) * (r % 2019)) % 2019)
    print(z)
Problem p02995 (python)

Fixed submission:
from math import floor

def gcd(a,b):
    while b:
        a, b = b , a%b
    return a

def lcm(a, b):
    return abs(a*b) // gcd(a, b)

A, B, C, D = map(int, input().split())

def n(n):
    c = n // C
    d = n // D
    cd = n // lcm(C,D)
    return n - c - d + cd

print(n(B)-n(A-1))

Buggy submission (verdict: Runtime Error):
from math import ceil, floor,gcd

def lcm(a, b):
    return abs(a*b) // gcd(a, b)

A, B, C, D = map(int, input().split())


Cdiff = floor(B/C) - floor((A-1)/C)
Ddiff = floor(B/D) - floor((A-1)/D)

CD = lcm(C,D)
CDdiff = floor(B/CD) - floor((A-1)/CD)



res = Cdiff+Ddiff-CDdiff
print((B-A+1)-res)
Problem p03000 (python)

Fixed submission:
N, X = map(int, input().split())
L = list(map(int, input().split()))
pref_sum = [0]*(N+1)
ans = 0

for i in range(N):
    pref_sum[i+1] = L[i]+pref_sum[i]



for s in pref_sum:
    if s <= X:
        ans += 1     
print(ans)

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

s = 0
i = 1

while s <= X:
    s += L[i-1]
    i += 1

print(i-1)
Problem p03220 (python)

Fixed submission:

N = int(input())
T, A = map(int, input().split())

elev_counted =[abs((T-x*0.006)-A) for x in map(int,input().split())]

print(elev_counted.index(min(elev_counted))+1)

Buggy submission (verdict: Runtime Error):
import numpy as np

N = int(input())
T, A = map(int, input().split())

elev_counted =[abs((T-x*0.006)-A) for x in map(int,input().split())]
print(np.argmin(elev_counted)+1)
Problem p03285 (python)

Fixed submission:
from math import ceil

N = int(input())
is_possible = False

for i in range((N//4)+1):
    for j in range((N//7)+1):
        if 4*i+7*j == N:
            is_possible = True
            break
    if is_possible:
        break

if is_possible:
    print("Yes")
else:
    print("No")

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


for i in range(26):
  n += 4
  if s % 7 == 0:
    print("Yes")
  if i == 25:
    print("No")
Problem p03308 (python)

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

print(max(ll)-min(ll))

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

Buggy submission (verdict: Runtime Error):
N = int(input())
ll = map(int,input())
 
print(max(ll)-min(ll))

Buggy submission (verdict: Runtime Error):
N = int(input())
ll = map(int,input())

print(max(ll)-min(ll))
Problem p03325 (python)

Fixed submission:
from math import log2

N = int(input())
L = list(map(int, input().split()))

res = 0

for num in L:
    l = num
    while (l % 2 == 0):
        res += 1
        l = l //  2
    
print(res)

Buggy submission (verdict: Runtime Error):
from math import log2

N = int(input())
L = list(map(int, input().split()))

res = 0

for l in L:
    while (l % 2 == 0):
        res += 1
        l = l //  2
    
print(res)
Problem p02641 (python)

Fixed submission:
x,n = map(int, input().split())
valid = [1] *101
p = list(map(int, input().split()))
for i in range(n):
	valid[p[i]] = 0

#print(valid)

for j in range(100):
#	print(x,j,x-j,x+j)
#	print(valid[x-j])
#	print(valid[x+j])
	if((x-j) >= 1):
		if(valid[x-j] == 1):
			print(x-j)
			break
	else:
		print(0)
		break
	if((x+j) <= 100):
#		print("aaa")
		if(valid[x+j] == 1):
			print(x+j)
			break
	else:
		print(101)
		break

Buggy submission (verdict: Runtime Error):
x,n = map(int, input().split())
valid = [1] *101
p = list(map(int, input().split()))
for i in range(n):
	valid[p[i]] = 0

for j in range(x):
	#print(x,j,x-j,x+j)
	if(valid[x-j] == 1):
		print(x-j)
		break
	elif(valid[x+j] == 1):
		print(x+j)
		break
Problem p02658 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
MAX = 10**18

ret = 1
for i in range(n):
	if(ret <= MAX):
		ret = ret*a[i]
	if(a[i] == 0):
		ret = 0
		break


if(ret > MAX):
	print(-1)
else:
	print(ret)

Buggy submission (verdict: Runtime Error):
 = int(input())
a = list(map(int, input().split()))
MAX = 10**18

ret = 1
for i in range(n):
	if(ret <= MAX):
		ret = ret*a[i]
	if(a[i] == 0):
		ret = 0
		break


if(ret > 10**18):
	print(-1)
else:
	print(ret)
Problem p02716 (python)

Fixed submission:
from collections import defaultdict
INF = -1000000000000001

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

a = int(n/2)

dpa = defaultdict(lambda: -INF)
#dpa = [[0 for j in range(a+1)] for i in range(n+1)]

dpa[(0,0)] = 0
dpa[(1,0)] = 0
dpa[(1,1)] = l[0]
j = 1
for i in range(2,n+1):
	if i == j*2:
		dpa[(i,j)] = max(dpa[(i-2,j-1)]+l[i-1],dpa[(i-1,j)])
#		print(i,j,dpa[(i,j)])
	else:
		dpa[(i,j)] = max(dpa[(i-2,j-1)]+l[i-1],dpa[(i-1,j)])
#		print(i,j,dpa[(i,j)])
		if (i != n):
			j += 1
#			print(i,j,dpa[(i,j)])
#			print("   ",i-2,j-1,dpa[(i-2,j-1)],"")
			dpa[(i,j)] = dpa[(i-2,j-1)]+l[i-1]

#print(dpa)
print(dpa[n,a])

Buggy submission (verdict: Runtime Error):
INF = -1000000000000001

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

a = int(n/2)

dpa = [[0]*(a+1) for i in range(n+1)]

dpa[0][0] = 0
dpa[1][0] = 0
dpa[1][1] = l[0]
j = 1
for i in range(2,n+1):
	if i == j*2:
		dpa[i][j] = max(dpa[i-2][j-1]+l[i-1],dpa[i-1][j])
#		print(i,j,dpa[i][j])
	else:
		dpa[i][j] = max(dpa[i-2][j-1]+l[i-1],dpa[i-1][j])
#		print(i,j,dpa[i][j])
		if (i != n):
			j += 1
#			print(i,j,dpa[i][j])
#			print("   ",i-2,j-1,dpa[i-2][j-1],"")
			dpa[i][j] = dpa[i-2][j-1]+l[i-1]

#print(dpa)
print(dpa[n][a])
Problem p02631 (python)

Fixed submission:
n = int(input())
xor_arr = list(map(int, input().split()))
xor_of_xor = 0
for elm in xor_arr:
    xor_of_xor = xor_of_xor ^ elm
scarf_val = [xor_of_xor ^ elm for elm in xor_arr]
         
print(" ".join(str(x) for x in scarf_val))

Buggy submission (verdict: Runtime Error):
        n = int(input())
        xor_arr = list(map(int, input().split()))
        xor_of_xor = 0
        for elm in xor_arr:
            xor_of_xor = xor_of_xor ^ elm
        scarf_val = [xor_of_xor ^ elm for elm in xor_arr]
        print(" ".join(str(x) for x in scarf_val))

Buggy submission (verdict: Runtime Error):
    n = int(input())
    xor_arr = list(map(int, input().split()))
    xor_of_xor = 0
    for elm in xor_arr:
        xor_of_xor = xor_of_xor ^ elm
    scarf_val = [xor_of_xor ^ elm for elm in xor_arr]
     
    print(" ".join(str(x) for x in scarf_val))
Problem p02621 (python)

Fixed submission:
a = int(input())
res = a + a**2 + a**3
print(res)

Buggy submission (verdict: Runtime Error):
N, M, K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
sum_list = []
for i in range(N):
  if K < sum(A[:i+1]):
    break
  for j in range(M):
    sum_ = sum(A[:i+1]) + sum(B[:j+1])
    if sum_ <= K:
      sum_list.append(len(A[:i+1]) + len(B[:j+1]))
    elif K < sum_:
      break
if 1 <= len(sum_list):
  print(max(sum_list))
elif 0 == len(sum_list):
  print(0)
Problem p03260 (python)

Fixed submission:
A, B = map(int, input().split())
flg = False
for i in range(1, 4):
    if (A * B * i) % 2 == 1:
        flg = True
        break
if flg:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
flg = True
for i in range(1, 4):
    if (A * B * i) % 2 == 1:
        flg = False
        break
if flg == False:
    print('Yes')
elif == True:
    print('No')
Problem p03470 (python)

Fixed submission:
N = int(input())

Ans = set()

for i in range(N):
	Ans.add(int(input()))
	
print(len(Ans))

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

lis = []

for i in range(N):
	lis.append(int(input()))
	
lis.sort(reverse = True)

for i in range(N):
	if N - 1 == i:
		break
	
	if lis.count(lis[i]) >= 2:
		del lis[i]
	

print(len(lis))
Problem p03487 (python)

Fixed submission:
from collections import Counter

N = int(input())

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

counter = Counter(numList)

ans = 0

for k, v in counter.items():
	if(k == v):
		continue
	elif(k < v):
		ans += v-k
	elif(k > v):
		ans += v

print(ans)

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

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

lis.sort()

Ans = 0

p = 0

while(True):
	
	if p >= N:
		break
	
	if lis[p] > lis.count(lis[p]):
		Ans += lis.count(lis[p])
		p += lis.count(lis[p])
	
	if lis[p] == lis.count(lis[p]):
		p += lis.count(lis[p])
	
	if lis[p] < lis.count(lis[p]):
		Ans += lis.count(lis[p]) - lis[p]
		p += lis.count(lis[p])
		
print(Ans)
Problem p03545 (python)

Fixed submission:
N = input()
a = int(N[0])
b = int(N[1])
c = int(N[2])
d = int(N[3])

if a+b+c+d ==7:
	print(str(a)+'+'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
	
elif a-b+c+d ==7:
	print(str(a)+'-'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
	
elif a-b-c+d ==7:
	print(str(a)+'-'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
	
elif a+b+c-d ==7:
	print(str(a)+'+'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
	
elif a+b-c-d ==7:
	print(str(a)+'+'+str(b)+'-'+str(c)+'-'+str(d)+'=7')
	
elif a-b+c-d ==7:
	print(str(a)+'-'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
	
elif a+b-c+d ==7:
	print(str(a)+'+'+str(b)+'-'+str(c)+'+'+str(d)+'=7')

elif a-b-c-d ==7:
	print(str(a)+'-'+str(b)+'-'+str(c)+'-'+str(d)+'=7')

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(str,input().split())
sign = "+-"
for i in range(2):  # 1つ目の記号
    for j in range(2):  # 2つ目の記号
        for k in range(2):  # 3つ目の記号
            if eval(a+sign[i]+b+sign[j]+c+sign[k]+d) == 7:
                print(str(a+sign[i]+b+sign[j]+c+sign[k]+d)+"=7")

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(str,input().split())
sign = "+-"
for i in range(2):  # 1つ目の記号
    for j in range(2):  # 2つ目の記号
        for k in range(2):  # 3つ目の記号
            if eval(a+sign[i]+b+sign[j]+c+sign[k]+d) == 7:
                print(str(a+sign[i]+b+sign[j]+c+sign[k]+d)+"=7")

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(str,input().split())
sign = "+-"
for i in range(3):  # 1つ目の記号
    for j in range(3):  # 2つ目の記号
        for k in range(3):  # 3つ目の記号
            if eval(a+sign[i]+b+sign[j]+c+sign[k]+d) == 7:
                print(str(a+sign[i]+b+sign[j]+c+sign[k]+d)+"=7")

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(str,input().split())
sign = "+-*"
for i in range(3):  # 1つ目の記号
    for j in range(3):  # 2つ目の記号
        for k in range(3):  # 3つ目の記号
            if eval(a+sign[i]+b+sign[j]+c+sign[k]+d) == 7:
                print(str(a+sign[i]+b+sign[j]+c+sign[k]+d)+"=7")

Buggy submission (verdict: Runtime Error):
N = input()
a = int(N[0])
b = int(N[1])
c = int(N[2])
d = int(N[3])

if a+b+c+d == 7:
	print('{0}+{1}+{2}+{3}=7' .format(a,b,c,d))
	
if a-b+c+d == 7:
	print('{0}-{1}+{2}+{3}=7' .format(a,b,c,d))

if a+b-c+d == 7:
	print('{0}+{1}-{2}+{3}=7' .format(a,b,c,d))

if a+b+c-d == 7:
	print('{0}+{1}+{2—{3}=7' .format(a,b,c,d))

if a-b-c+d == 7:
	print('{0}-{1}-{2}+{3}=7' .format(a,b,c,d))
	
if a+b-c-d == 7:
	print('{0}+{1}-{2}-{3}=7' .format(a,b,c,d))
	
if a-b+c-d == 7:
	print('{0}-{1}+{2}-{3}=7' .format(a,b,c,d))

if a-b-c-d == 7:
	print('{0}-{1}-{2}-{3}=7' .format(a,b,c,d))

Buggy submission (verdict: Runtime Error):
N = input()
a = int(N[0])
b = int(N[1])
c = int(N[2])
d = int(N[3])

if a+b+c+d == 7:
	print('{0}+{1}+{2}+{3}=7' .format(a,b,c,d))
	
if a-b+c+d == 7:
	print('{0}-{1}+{2}+{3}=7' .format(a,b,c,d))

if a+b-c+d == 7:
	print('{0}+{1}-{2}+{3}=7' .format(a,b,c,d))

if a+b+c-d == 7:
	print('{0}+{1}+{2—{3}=7' .format(a,b,c,d))

if a-b-c+d == 7:
	print('{0}-{1}-{2}+{3}=7' .format(a,b,c,d))
	
if a+b-c-d == 7:
	print('{0}+{1}-{2}-{3}=7' .format(a,b,c,d))
Problem p03563 (python)

Fixed submission:
R = int(input())
G = int(input())
X = 2*G - R
print(X)

Buggy submission (verdict: Runtime Error):
R,G = map(float, input().split())

X = 2*G - R
print(int(X))

Buggy submission (verdict: Runtime Error):
R,G = map(float, input().split())

X = 2*G - R
print(X)
Problem p03760 (python)

Fixed submission:
O = input()

E = input()

Ans = ""

for i in range(len(O)):
	Ans += O[i]
	if i < len(E):
		Ans += E[i]
print(Ans)

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

E = input()

Ans = ""

for i in range(len(O)):
	Ans += O[i]
	Ans += E[i]
print(Ans)

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

E = input()

Ans = ""

for i in range(max(len(O),len(E))):
	Ans += O[i]
	Ans += E[i]
	
print(Ans)
Problem p02717 (python)

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

print(z,x,y)

Buggy submission (verdict: Runtime Error):
x = input() y = input() z = input()
print(z) print(x) print(y)
Problem p02630 (python)

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

sum=0
num=[0]*(10**5+1)
for i in range(n):
    sum+=a[i]
    num[a[i]]+=1

q=int(input())
for i in range(q):
    b,c=map(int,input().split())
    sum+=(c-b)*num[b]
    print(sum)
    num[c]+=num[b]
    num[b]=0

Buggy submission (verdict: Runtime Error):
from collections import Counter
def change_dict_key(d, old_key, new_key, default_value=None):
    d[new_key] = d.pop(old_key, default_value)

n=int(input())
a=list(map(int,input().split()))
a_cnt = Counter(a)

q=int(input())
for i in range(q):
    b,c=map(int,input().split())
    if b in a_cnt.keys():
        if c in a_cnt.keys():
            a_cnt[c]+=a_cnt[b]
            tmp=a_cnt[b]
            a_cnt.pop(b)
        else:
            change_dict_key(a_cnt,b,c)
    if i==0:
        ans=0
        for key,value in a_cnt.items():
            ans+=key*value
        print(ans)
    else:
        ans+=(c-b)*tmp
        print(ans)
Problem p02761 (python)

Fixed submission:
n,m = map(int, input().split())
sc = [ list(map(int,input().split())) for _ in range(m)]

ans = [0] * n
change_cnt = [0] * n
if n >= 2:
    ans[0]=1
for i in range(n):
    for j in range(m):
        if i+1 == sc[j][0]:
            if ans[i] != sc[j][1]:
                ans[i] = sc[j][1]
                change_cnt[i] += 1
                if change_cnt[i] > 1:
                    print(-1)
                    exit()

if n>=2:
    if ans[0]==0:
        print(-1)
        exit()

answer = ''
for i in range(len(ans)):
    answer += str(ans[i])

print(int(answer))

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
sc = [ list(map(int,input().split())) for _ in range(m)]

ans = [0] * n
change_cnt = [0] * n
if n >= 2:
    ans[0]=1
for i in range(n):
    for j in range(m):
        if i+1 == sc[j][0]:
            if ans[i] != sc[j][1]:
                ans[i] = sc[j][1]
                change_cnt[i] += 1
                if change_cnt[i] > 1:
                    print(-1)
                    exit()

if n>=2:
    if ans[0]==0:
        print(-1)
        exti()

answer = ''
for i in range(len(ans)):
    answer += str(ans[i])

print(int(answer))
Problem p02767 (python)

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

answers=[]
for i in range(min(x)-1,max(x)+1):
    sum=0
    for j in range(n):
        sum+=(x[j]-i)**2
    answers.append(sum)

print(min(answers))

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

answers=[]
for i in range(min(x),max(x)):
    sum=0
    for j in range(n):
        sum+=(x[j]-i)**2
    answers.append(sum)

print(min(answers))
Problem p02882 (python)

Fixed submission:
import math

a,b,x=map(int,input().split())

if x==a**2*b:
    print(0.0)
elif x>a**2*b/2:
    print(90.0-math.degrees(math.atan(a**3/(2*a**2*b-2*x))))
else:
    print(90.0-math.degrees(math.atan(2*x/(a*b**2))))

Buggy submission (verdict: Runtime Error):
import math

a,b,x=map(int,input().split())

if x==a**2*b/2:
    print(45.0)
elif x>a**2*b/2:
    print(90.0-math.degrees(math.atan(a**3/(2*a**2*b-2*x))))
else:
    print(90.0-math.degrees(math.atan(2*x/(a*b**2))))

Buggy submission (verdict: Runtime Error):
import math

a,b,x=map(int,input().split())

if x>=a**2*b/2:
    print(90.0-math.degrees(math.atan(a**3/(2*a**2*b-2*x))))
else:
    print(90.0-math.degrees(math.atan(2*x/(a*b**2))))
Problem p02888 (python)

Fixed submission:
from bisect import bisect_left
N = int(input())
L = sorted(list(map(int, input().split())))
 
ans = 0
for i in range(N):  # １番短い棒
    for j in range(i + 1, N):  # 真ん中の長さの棒
        ans += bisect_left(L, L[i] + L[j]) - (j + 1)
 
print(ans)

Buggy submission (verdict: Runtime Error):
from bisect import bisect_left

n=int(input())
l=sorted(list(map(int,input().split())))

ans=0
for i in range(n):
    for j in range(i+1,n):
        ans+=bisect.bisect_left(l[j+1:], l[i]+l[j])

print(ans)
Problem p02900 (python)

Fixed submission:
from fractions import gcd

a,b=map(int,input().split())

gcd=gcd(a,b)
ab_gcd=gcd

f=[]
for i in range(2,int(ab_gcd**0.5)+1):
    while gcd%i==0:
        gcd=gcd//i
        f.append(i)
if gcd!=1:
    f.append(gcd)

print(len(set(f))+1)

Buggy submission (verdict: Runtime Error):
from fractions import gcd

a,b=map(int,input().split())

gcd=gcd(a,b)

f=[]
for i in range(2,int(gcd(a,b)**0.5)+1):
    while gcd%i==0:
        gcd=gcd//i
        f.append(i)
        break
print(len(set(f))+1)