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

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

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

Fixed submission:
N=int(input())
if N==1:
    print("Hello World")
if N==2:
    A=int(input())
    B=int(input())
    print(A+B)

Buggy submission (verdict: Runtime Error):
N=int(input())
x=[]
y=[]
h=[]
for i in range(N):
    x_n,y_n,h_n=map(int,input().split())
    if h_n >= 1:
        x.append(x_n)
        y.append(y_n)
        h.append(h_n)

def all_same(a):
    if all(a[i]==a[i+1] for i in range(0,len(a)-1)):
        return True
    else:
        return False

for C_x in range(101):
    for C_y in range(101):
        H=[]
        for i in range(len(x)):
            H.append(h[i]+abs(x[i]-C_x)+abs(y[i]-C_y))
        H.sort()
        if all_same(H):
            print(C_x,C_y,H[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
x=[]
y=[]
h=[]
for i in range(N):
    x_n,y_n,h_n=map(int,input().split())
    if h_n !=0:
        x.append(x_n)
        y.append(y_n)
        h.append(h_n)

def all_same(a):
    if all(a[i]==a[i+1] for i in range(0,len(a)-1)):
        return True
    else:
        return False

for C_x in range(101):
    for C_y in range(101):
        H=[]
        for i in range(len(x)):
            H.append(h[i]+abs(x[i]-C_x)+abs(y[i]-C_y))
        H.sort()
        H.remove(0)
        if all_same(H):
            print(C_x,C_y,H[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
x=[]
y=[]
h=[]
for i in range(N):
    x_n,y_n,h_n=map(int,input().split())
    x.append(x_n)
    y.append(y_n)
    h.append(h_n)
for C_x in range(101):
    for C_y in range(101):
        H=h[0]+abs(x[0]-C_x)+abs(y[0]-C_y)
        if all(H==h[i]+abs(x[i]-C_x)+abs(y[i]-C_y) for i in range(N)):
            print(C_x,C_y,H)

Buggy submission (verdict: Runtime Error):
N=int(input())
x=[]
y=[]
h=[]
for i in range(N):
    x_n,y_n,h_n=map(int,input().split())
    x.append(x_n)
    y.append(y_n)
    h.append(h_n)
for C_x in range(101):
    for C_y in range(101):
        if all(h[i]+abs(x[i]-C_x)+abs(y[i]-C_y)==h[i+1]+abs(x[i+1]-C_x)+abs(y[i+1]-C_y) for i in range(N-1)):
            if h[1]+abs(x[1]-C_x)+abs(y[1]-C_y) >1 or h[1]+abs(x[1]-C_x)+abs(y[1]-C_y)==1:
                H=h[1]+abs(x[1]-C_x)+abs(y[1]-C_y)
                print(C_x,C_y,H)
Problem p03633 (python)

Fixed submission:
from fractions import gcd
def lcm(a,b):
    return a*b//gcd(a,b)
N=int(input())
T=int(input())
for i in range(N-1):
    t=int(input())
    T=lcm(t,T)
print(T)

Buggy submission (verdict: Runtime Error):
import numpy as np
def lcd(a,b):
  return a*b//np.gcd(a,b)
N=int(input())
T=int(input())
for i in range(N-1):
  t=int(input())
  T=lcd(t,T)
print(T)

Buggy submission (verdict: Runtime Error):
from math import gcd
def lcm(a,b):
  return a*b//gcd(a,b)
N=int(input())
T=int(input())
for i in range(N-1):
  t=int(input())
  T=lcm(T,t)
print(T)
Problem p04000 (python)

Fixed submission:
inp=input().split(" ")
H=int(inp[0])
W=int(inp[1])
N=int(inp[2])
plot=[]
times=[0 for i in range(10)]
times[0]=(H-2)*(W-2)
from collections import defaultdict
count=defaultdict(lambda:0)
def check(a,b,count):
    for i in range(3):
        for j in range(3):
            if a-i>=0 and b-j>=0 and a+2-i<=H-1 and b+2-j<=W-1:
                count[str([a-i,b-j])]+=1
for i in range(N):
    plot.append(list(map(int,input().split(" "))))
    check(plot[i][0]-1,plot[i][1]-1,count)
for i in count.values():
    times[i]+=1
    times[0]-=1
for i in range(len(times)):
    print(times[i])

Buggy submission (verdict: Runtime Error):
inp=input().split(" ")
H=int(inp[0])
W=int(inp[1])
N=int(inp[2])
square=[]
plot=[]
times=[0 for i in range(10)]
times[0]=(H-2)*(W-2)
from collections import defaultdict
count=defaultdict(lambda:0)
def check(a,b,count):
    for i in range(3):
        for j in range(3):
            if a-i>=0 and b-j>=0 and a+2-i<=H-1 and b+2-j<=W-1:
                count[str([a-i,b-j])]+=1
for i in range(N):
    plot.append(list(map(int,input().split(" "))))
    check(plot[i][0]-1,plot[i][1]-1,square)
for i in count.values():
    times[i]+=1
    times[0]-=1
for i in range(len(times)):
    print(times[i])
Problem p04013 (python)

Fixed submission:
inp=input().split(" ")
N=int(inp[0])
A=int(inp[1])
x=list(map(int, input().split(" ")))
y=[x[i]-A for i in range(N)]
y=[0]+y
X=max(x)
dp=[[0 for i in range(2*N*X+1)] for j in range(N+1)]
for j in range(N+1):
    for t in range(2*N*X+1):
        if j==0 and t==N*X:
            dp[j][t]=1
        elif j>=1 and (t-y[j]<0 or t-y[j]>2*X*N):
            dp[j][t]=dp[j-1][t]
        elif j>=1 and 0<=t-y[j] and t-y[j]<=2*N*X:
            dp[j][t]=dp[j-1][t]+dp[j-1][t-y[j]]
        else:
            dp[j][t]=0
print(dp[N][N*X]-1)

Buggy submission (verdict: Runtime Error):
inp=input().split(" ")
N=int(inp[0])
A=int(inp[1])
x=list(map(int, input().split(" ")))
x=[0]+x
X=max(x)
dp=[[[0 for i in range(N*X+1)] for j in range(N+1)] for k in range(N+1)]
for j in range(N+1):
    for k in range(N+1):
     for s in range(N*X+1):
        if j==0 and k==0 and s==0:
            dp[j][k][s]=1
        elif j>=1 and s<x[j]:
            dp[j][k][s]=dp[j-1][k][s]
        elif j>=1 and k>=1 and s>=x[j]:
            dp[j][k][s]=dp[j-1][k][s]+dp[j-1][k-1][s-x[j]]
        else:
            dp[j][k][s]=0
print(sum(dp[N][k][k*A] for k in range(1,N+1)))
Problem p04014 (python)

Fixed submission:
n=int(input())
s=int(input())
ans="-1"
def f(b,n):
    if n<b:
        return n
    else:
        return f(b,n//b)+n%b
if n==s:
    ans=n+1
for b in range(2,int(n**(1/2)+1)):
    if f(b,n)==s:
        ans=b
        break
if ans=="-1":
    for p in range(int(n**(1/2)+1),0,-1):
        b=int((n-s)/p)+1
        if b>=2:
            if f(b,n)==s:
                ans=b
                break
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=int(input())
a="-1"
def f(b,n):
    if n<b:
        return n
    else:
        return f(b,n//b)+n%b
if n==s:
    a=n+1
i=2
while 0<=i<=n**(1/2):
    if f(i,n)==s:
        a=i
        break
    i+=1
if a=="-1":
    for p in range(1,int(n**(1/2))):
        b=(n-s)/p+1
        if f(b,n)==s:
            a=b
            break
print(int(a))
Problem p02645 (python)

Fixed submission:
s=input()
print(s[0:3])

Buggy submission (verdict: Runtime Error):
s=input()
l=[]
i=0
while len(l)!=3:
  if s[i] not in l:
    l.append(s[i])
  else:
    l.clear()
    l.append(s[i])
  i+=1
print(''.join(l))
Problem p02706 (python)

Fixed submission:
a,b=map(int,input().split())
c=input().split()
l=[]
for i in c:
  l.append(int(i))
if sum(l)>a:
  print(-1,end="")
else:
  print(a-sum(l),end="")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split)
c=input().split()
l=[]
for i in c:
  l.append(int(i))
if sum(l)>a:
  print(-1,end="")
else:
  print(a-sum(l),end="")
Problem p02660 (python)

Fixed submission:
import math

N = int(input())

def judge(n):
    if n <= 1:
        return False
    for i in range(2, int(math.sqrt(n))+1):
        if n % i == 0:
            n //= i
            while n != 1:
                if n % i != 0:
                    return False
                n //= i
            return True
    return True


def get_prime(n):
    if n <= 1:
        return []
    prime = [2]
    limit = int(math.sqrt(n))

    data = [i + 1 for i in range(2, n, 2)]
    while limit > data[0]:
        prime.append(data[0])
        data = [j for j in data if j % data[0] != 0]
    return prime + data

ans = 0
i = 2
limit = int(math.sqrt(N))
while N != 1:
    
    if i > limit:
        if N > i:
            ans += 1
        break
    if N % i == 0 and judge(i): 
        N //= i
        ans += 1
        
    i += 1
    
print(ans)

Buggy submission (verdict: Runtime Error):
import math
from sympy import isprime
N = int(input())

z = []

def isprime(n):
    if n <= 1:
        return False
    for i in range(2, int(math.sqrt(n)) + 1):
        if n % i == 0:
            return False
    return True
    
def judge(n):
    if isprime(n):
        return True
    for i in range(2, int(math.sqrt(n)+1)):
        if n % i == 0:
            n = n // i
            while n != 1:
                if n % i != 0:
                    return False
                n //= i
            return True
        return False


ans = 0
num = []
i = 2
while N != 1:
    
    if isprime(N):
        ans += 1
        break
    if N % i == 0 and judge(i): 
        N //= i
        ans += 1
        num.append(i)

    i += 1
    



print(ans)

Buggy submission (verdict: Runtime Error):
import math
from sympy import isprime
N = int(input())

z = []

def judge(n):
    if isprime(n):
        return True
    for i in range(2, int(math.sqrt(n)+1)):
        if n % i == 0:
            n = n // i
            while n != 1:
                if n % i != 0:
                    return False
                n //= i
            return True
        return False


ans = 0
num = []
i = 2
while N != 1:
    
    if isprime(N):
        ans += 1
        break
    if N % i == 0 and judge(i): 
        N //= i
        ans += 1
        num.append(i)

    i += 1
    



print(ans)
Problem p02714 (python)

Fixed submission:
N = int(input())
S = input()

r_cnt = S.count('R')
g_cnt = S.count('G')
b_cnt = S.count('B')

ans = r_cnt * g_cnt * b_cnt

for i in range(N):
    for d in range(N):
        j = i+d
        k = j+d
        if k >= N:
            break
        if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
            ans -= 1
print(ans)

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

r_cnt = S.count('R')
g_cnt = S.count('G')
b_cnt = S.count('B')

ans = r_cnt * g_cnt * b_cnt

for i in range(1,N+1):
    for d in range(1, N+1):
        j = i+d
        k = j+d
        if k > N:
            break
        if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
            ans -= 1
print(ans)
Problem p03240 (python)

Fixed submission:
N = int(input())
lis = []
for _ in range(N):
    x, y, h = map(int, input().split())
    if h > 0:
        sx, sy, sh = x, y, h
    lis.append((x, y, h))
for i in range(101):
    for j in range(101):
        high = sh + abs(sx - i) + abs(sy - j)
        judge = -1
        for x, y, h in lis:
            if h > 0 and high != h + abs(x - i) + abs(y - j):
                judge = 0
                break
        if judge == 0:
            continue
        for x, y, h in lis:
            if h == 0 and high > abs(x - i) + abs(y - j):
                judge = 0
                break
        if judge == 0:
            continue
        
        print(i, j, sh + abs(sx - i) + abs(sy - j))
        exit()

Buggy submission (verdict: Runtime Error):
N = int(input())
lis = []
for _ in range(N):
    x, y, h = map(int, input().split())
    if h != 0:
        lis.append([x, y, h])
        sx, sy, sh = x, y, h

for i in range(101):
    for j in range(101):
        
        cx, cy = i, j
        for K in range(len(lis)):
            x, y, h = lis[K]
            
            if h > 0 and sh + abs(sx - cx) + abs(sy - cy) != h + abs(cx - x) + abs(cy -y):
                break
            elif sh +  abs(sx - cx) + abs(sy - cy) > abs(cx - x) + abs(cx + y):
                break
            if K == len(lis) - 1:
                print(cx, cy, hight)
                exit()
Problem p03263 (python)

Fixed submission:
H, W = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(H)]
output = []
for i in range(H-1):
    for j in range(W):
        if a[i][j] % 2 == 1:
            a[i+1][j] += 1
            output.append((i+1, j+1, i+2, j+1))

for i in range(W-1):
    if a[-1][i] % 2 == 1:
        a[-1][i+1] += 1
        output.append((H, i+1, H, i+2))
print(len(output))
for y, x, ay, ax in output:
    print(y, x, ay, ax)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(H)]
output = []
for i in range(H-1):
    for j in range(W):
        if a[i][j] % 2 == 1:
            a[i+1][j] += 1
            output.append([i+1, j+1, i+2, j+1])

for i in range(W):
    if a[-1][i] % 2 == 1:
        a[-1][i+1] += 1
        output.append([H, i+1, H, i+2])
print(len(output))
for o in output:
    for xy in o:
        print(xy, end=' ')
    print()
Problem p03473 (python)

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

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

if (N[0] == N[1] and N[1] == N[2]) or (N[1] == N[2] and N[1] == N[3]):
    print('Yes')
else:
    print('No')
Problem p03476 (python)

Fixed submission:
import math
import sys
sys.setrecursionlimit(10000000)
Q = int(input())
l_r = [list(map(int, input().split())) for _ in range(Q)]

prime = []
def isprime(n):
    if n in prime:
        return True
    if n <= 1:
        return False
    for i in range(2, int(math.sqrt(n)) + 1):
        if n % i == 0:
            return False
    
    return True


def like(x):
    if isprime(x) and isprime((x+1)//2):
        return True
    
    return False

x_dict = {1:0}
def count_like(x):
    if x in x_dict:
        return x_dict[x]
    x_dict[x] = count_like(x-1) + like(x)
    return x_dict[x]

for i in range(Q):
    print(count_like(l_r[i][1]) - count_like(l_r[i][0]) + int(like(l_r[i][0])))

Buggy submission (verdict: Runtime Error):
import sympy
Q = int(input())
l_r = [list(map(int, input().split())) for _ in range(Q)]

def like(x):
    if sympy.isprime(x) and sympy.isprime((x+1)//2):
        return True
    
    return False

x_list = [0] * (10 ** 5)
for i in range(1, 10**5, 2):
    if like(i):
        x_list[i] = 1

for i in range(Q):
    print(sum(x_list[l_r[i][0]: l_r[i][1]+1]))
Problem p03543 (python)

Fixed submission:
N = input()

if (N[0] == N[1] and N[1] == N[2]) or (N[1] == N[2] and N[1] == N[3]):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A == B:
    print(C)
elif B == C:
    print(A)
else:
    print(B)
Problem p03573 (python)

Fixed submission:
A, B, C = map(int, input().split())
if A == B:
    print(C)
elif B == C:
    print(A)
else:
    print(B)

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input(),split())
if A == B:
    print(C)
elif B == C:
    print(A)
else:
    print(B)
Problem p03625 (python)

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

x = 0
y = 0
selection = sorted(list(set(A)))[::-1]
c = collections.Counter(A)
for i in selection:
    if c[i] >= 4:
        if x == 0:
            x = i
        if y == 0:
            y = i
    elif c[i] >= 2:
        if x == 0:
            x = i
        elif y == 0:
            y = i
    if x != 0 and y != 0:
        print(x * y)
        exit()

print(x * y)

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

edge_list =  []
selection = list(set(A)).sort()[::-1]

for i in selection:
    edge_list += i * (A.count(i) // 2)
    if len(edge_list) >= 2:
        break
edge_list.sort()

if len(edge_list) < 2:
    print(0)
else:
    print(int(edge_list[-1]) * int(edge_list[-2]))
Problem p03633 (python)

Fixed submission:
import fractions
N = int(input())
T = [int(input()) for _ in range(N)]
ans = T[0]
for i in range(1, N):
    ans = (ans * T[i]) // fractions.gcd(ans, T[i])

print(ans)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
T = [int(input()) for _ in range(N)]
ans = T[0]
for i in range(1, N):
    ans = (ans * T[i]) // math.gcd(ans, T[i])

print(ans)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
T = [int(input()) for _ in range(N)]
ans = T[0]
for i in range(1, N):
    ans = ans * T[i] // math.gcd(ans, T[i])

print(ans)
Problem p03695 (python)

Fixed submission:
N = int(input())
a = list(map(lambda x: int(x) // 400, input().split()))
s_a = []
b_a = []

for i in range(N):
    if a[i] <= 7:
        s_a.append(a[i])
    else:
        b_a.append(a[i])

if len(s_a) == 0:
    min = 1
else:
    min = len(set(s_a))


max = len(set(s_a)) + len(b_a)


print(min, max)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(lambda x: int(x) // 400, input().split()))
s_a = []
b_a = []

for i in range(N):
    if a[i] <= 7:
        s_a.append(a[i])
    else:
        b_a.append(a[i])

if len(s_a) == 0:
    min = 1
else:
    min = len(set(s_a))

if len(set(s_a)) + len(b_a) <= :
    max = len(set(s_a)) + len(b_a)
else:
    max = 7

print(min, max)
Problem p03721 (python)

Fixed submission:
N, K = map(int, input().split())
a_b = [list(map(int, input().split())) for i in range(N)]
a_b.sort()
index = 0

for i in range(N):
    index += a_b[i][1]
    if index >= K:
        print(a_b[i][0])
        exit()

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
a_b = [list(map(input().split())) for i in range(N)]
a_b.sort()
index = 0

for i in range(N):
    index += a_b[i][1]
    if index >= K:
        print(a_b[i][0])
        exit()
Problem p03722 (python)

Fixed submission:
N, M = map(int, input().split())
edges = []
for i in range(M):
    a, b, c = map(int, input().split())
    edges.append([a, b, -c])
def bellman_ford(edges, N):
    dist = [float('inf') for i in range(N)]
    dist[0] = 0
    for i in range(N-1):
        for edge in edges:
            if dist[edge[1] - 1] > dist[edge[0] - 1] + edge[2]:
                dist[edge[1] - 1] = dist[edge[0] - 1] + edge[2]
    negative = [False] * N

    for i in range(N):
        for edge in edges:
            if dist[edge[1] - 1] > dist[edge[0] - 1] + edge[2]:
                dist[edge[1] - 1] = dist[edge[0] - 1] + edge[2]
                negative[edge[1] - 1] = True
            if negative[edge[0] - 1] == True:
                negative[edge[1] - 1] =True
    
    return 'inf' if negative[-1] else -dist[-1]

print(bellman_ford(edges, N))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
edges = []
for i in range(M):
    a, b, c = map(int, input().split())
    edges.append([a, b, -c])
def bellman_ford(edges, N):
    dist = [float('inf') for i in range(N)]
    dist[0] = 0
    for i in range(N-1):
        for edge in edges:
            if dist[edge[1] - 1] > dist[edge[0] - 1] + edge[2]:
                dist[edge[1] - 1] = dist[edge[0] - 1] + edge[2]
    negative = ['false'] * len(N)

    for i in range(N):
        for edge in edges:
            if dist[edge[1] - 1] > dist[edge[0] - 1] + edge[2]:
                dist[edge[1] - 1] = dist[edge[0] - 1] + edge[2]
                negative[edge[1] - 1] = True
            if negative[edge[0] - 1] == True:
                negative[edge[1] - 1] =True

    return 'inf' if negative[-1] else -dist[-1]

print(bellman_ford(edges, N))
Problem p03729 (python)

Fixed submission:
A, B, C = input().split()
print('YES' if A[-1]==B[0] and B[-1]==C[0] else 'NO')

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A % B == 0:
    if C == 0:
        print('YES')
    else:
        print('NO')
elif A > B:
    if C % (A % B) == 0 or (B - C) % (A % B) == 0:
        print('YES')
    else:
        print('NO')
else:
    if C % (B - A) == 0 or (B - C) % A == 0 or (B - C) % (B % A):
        print('YES')
    else:
        print('NO')
Problem p03730 (python)

Fixed submission:
A, B, C = map(int, input().split())
C_list = []
if A >= B:
    num = A % B
    while num not in C_list:
        C_list.append(num)
        num += A % B
        if num >= B:
            num -= B
elif A < B:
    num = A
    while num not in C_list:
        C_list.append(num)
        num += A
        if num >= B:
            num -= B
print('YES' if C in C_list else 'NO')

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A % B == 0:
    if C == 0:
        print('YES')
    else:
        print('NO')
elif A > B:
    if C % (A % B) == 0 or (B - C) % (A % B) == 0:
        print('YES')
    else:
        print('NO')
else:
    if C % (B - A) == 0 or (B - C) % A == 0 or (B - C) % (B % A):
        print('YES')
    else:
        print('NO')

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A == B:
    if C == 0:
        print('YES')
    else:
        print('NO')
elif A > B:
    if C % (A % B) == 0 or (B - C) % (A % B) == 0:
        print('YES')
    else:
        print('NO')
else:
    if C % (B - A) == 0 or (B - C) % A == 0 or (B - C) % (B % A):
        print('YES')
    else:
        print('NO')

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A == B:
    if C == 0:
        print('YES')
    else:
        print('NO')
elif A > B:
    if C % (A % B) == 0 or (B - C) % (A % B) == 0:
        print('YES')
    else:
        print('NO')
else:
    if C % (A % B) == 0 or (B - C) % (B % A) == 0:
        print('YES')
    else:
        print('NO')
Problem p03737 (python)

Fixed submission:
s1, s2, s3 = input().split()

ans = s1[0] + s2[0] + s3[0]

print(ans.upper())

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
count = 0
sum_ = 0
for i in range(n):
    if sum_ * (sum_+a[i]) <0 or i == 0:
        sum_ += a[i]
    elif sum_ > 0:
        count += sum_+a[i]+1
        a[i] = -sum_-1
        sum_ += a[i]
    elif sum_ < 0:
        count += abs(sum_+a[i])+1
        a[i] = -sum_+1
        sum_ += a[i]

print(count)
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)
Problem p03844 (python)

Fixed submission:
A, _, B = input().split()
A, B = int(A), int(B)
print(A+B if _=='+' else A-B)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]
m_count = 0
m_str = []

for i in range(N):
    if S.count(S[i]) > m_count:
        m_str = [S[i]]
        m_count = S.count(S[i])
    elif S.count(S[i]) == m_count:
        m_str.append(S[i])

m_str = list(set(m_str))
m_str.sort()

print(m_str[i] for i in len(m_str))
Problem p03846 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
judge = 1
while 0 in A:
    A.remove(0)

A_ = list(set(A))
A_.sort()
for i in range(len(A_) - 1):
    if A_[i+1] == A_[i]+2:
        judge = 1
    else:
        judge = 0

if len(set(A)) == len(A)/2 and judge:
    print((2 ** (len(A) // 2)) % (10**9 +7))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]
m_count = 0
m_str = []

for i in range(N):
    if S.count(S[i]) > m_count:
        m_str = [S[i]]
        m_count = S.count(S[i])
    elif S.count(S[i]) == m_count:
        m_str.append(S[i])

m_str = list(set(m_str))
m_str.sort()

print(m_str[i] for i in len(m_str))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]
m_count = 0
m_str = []

for i in range(N):
    if S.count(S[i]) > m_count:
        m_str = [S[i]]
        m_count = S.count(S[i])
    elif S.count(S[i]) == m_count:
        m_str.append(S[i])

m_str = list(set(m_str))
m_str.sort()

print(m_str[i] for i in len(m_str))

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

while 0 in A:
    A.remove(0)

A_ = list(set(A))
A_.sort()
for i in range(len(A_) - 1):
    if A_[i+1] == A_[i]+2:
        judge = 1
    else:
        judge = 0

if len(set(A)) == len(A)/2 and judge:
    print((2 ** (len(A) // 2)) % (10**9 +7))
else:
    print(0)

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

while 0 in A:
    A.remove(0)

A_ = list(set(A))
A_.sort()
for i in range(len(A_) - 1):
    if A_[i+1] == A_[i]+2:
        judge = 1
    else:
        judge = 0

if len(set(A)) == len(A)/2 and judge:
    print(2 ** (len(A) // 2))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
judge = 0
while 0 in A:
    A.remove(0)
for i in range(len(set(A))):
    if set(A)[i+1] - set(A)[i] == 2:
        judge = 1
    else:
        judge = 0
        break
if len(set(A)) == len(A)/2 and judge:
    print(2 ** (len(A) // 2))
else:
    print(0)