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

Fixed submission:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    plus = []
    minus = []
    for i in a:
        if i > 0:
            plus.append(i)
        elif i < 0:
            minus.append(i)
        else:
            if len(minus) == 0:
                minus.append(i)
            else:
                plus.append(i)
    plus.sort(reverse=True)
    minus.sort()
    if len(minus) == 0:
        minus.append(plus.pop())
    elif len(plus) == 0:
        plus.append(minus.pop())
    print(sum(plus)-sum(minus))
    now = minus[-1]
    for i in range(len(plus) - 1):
        print(now, plus[i])
        now -= plus[i]
    print(plus[-1], now)
    now = plus[-1] - now
    for i in range(len(minus) - 1):
        print(now, minus[i])
        now -= minus[i]
main()

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
ans_list=[]
if len(A)%2==1:
    for i in range(len(A)-1):
        m=min(A)
        M=max(A)
        A.remove(m)
        A.remove(M)
        if i%2==0:
            ans_list.append([m,M])
            A.append(m-M)
        else:
            ans_list.append([M,m])
            A.append(M-m)
else:
    for i in range(len(A)-1):
        m=min(A)
        M=max(A)
        ans_list.append([])
        A.remove(m)
        A.remove(M)
        if i%2==0:
            ans_list.append([M,m])
            A.append(M-m)
        else:
            ans_list.append([m,M])
            A.append(m-M)

print(A[0])
for i in range(N-1):
    print(ans_list[i][0],ans_list[i][1])
Problem p03025 (python)

Fixed submission:
def main():
    mod = 10**9+7
    fact = [1]*200001
    for i in range(1, 200001):
        fact[i] = fact[i-1]*i % mod

    def inv_n(n, mod=10**9+7): return pow(n, mod-2, mod)
    def nCr(n, r, mod=10**9 +
            7): return inv_n(fact[n-r]*fact[r] % mod, mod)*fact[n] % mod

    n, a, b, c = map(int, input().split())
    ans = 0
    for i in range(n, 2*n):
        j = i*100*inv_n(a+b) % mod
        ans = (ans + j*nCr(i-1, n-1)*(pow(a, n, mod)*pow(b, i-n, mod) +
                                      pow(a, i-n, mod)*pow(b, n, mod))*inv_n(pow(a+b, i, mod))) % mod
    print(ans)


main()

Buggy submission (verdict: Runtime Error):
    mod = 10**9+7
    fact = [1]*200001
    for i in range(1, 200001):
        fact[i] = fact[i-1]*i % mod

    def inv_n(n, mod=10**9+7): return pow(n, mod-2, mod)
    def nCr(n, r, mod=10**9 +
            7): return inv_n(fact[n-r]*fact[r] % mod, mod)*fact[n] % mod

    n, a, b, c = map(int, input().split())
    ans = 0
    for i in range(n, 2*n):
        j = i*100*inv_n(a+b) % mod
        ans = (ans + j*nCr(i-1, n-1)*(pow(a, n, mod)*pow(b, i-n, mod) +
                                      pow(a, i-n, mod)*pow(b, n, mod))*inv_n(pow(a+b, i, mod))) % mod
    print(ans)


main()
Problem p03048 (python)

Fixed submission:
R,G,B,N=map(int,input().split())
cnt=0
for i in range(N//R+1):
    for j in range((N-i*R)//G+1):
            if i*R + j*G +((N-i*R-j*G)//B)*B==N:
                cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
def main():
    R,G,B,N=map(int,input().split())
    cnt=0
    for i in range(N//R+1):
        cnt+=sum([1 for j in range((N-i*R)//G+1) if i*R + j*G +((N-p-j*G)//B)*B==N])
    print(cnt)

main()
Problem p03061 (python)

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

def gcd(x,y):
    if y > x:
        x,y = y,x
    if y == 0:
        return x
    if x%y == 0:
        return y
    else:
        return gcd(x%y,y)

L = [0]
for i in range(N):
    L.append(gcd(L[i],A[i]))
R = [0]
for i in range(N):
    R.append(gcd(R[i],A[-(i+1)]))

print(max([gcd(L[i],R[N-i-1]) for i in range(N)]))

Buggy submission (verdict: Runtime Error):
from math import gcd
N=int(input())
A=list(map(int,input().split()))
left,right=[0],[0]
[(left.append(gcd(left[i],A[i])),right.append(gcd(right[i],A[N-i-1]))) for i in range(N-1)]
right.reverse()
print(max([gcd(a,b) for a,b in zip(left,right)]))

Buggy submission (verdict: Runtime Error):
from math import gcd
N=int(input())
A=list(map(int,input().split()))
left,right=[0],[0]
[(left.append(gcd(left[i],A[i])),right.append(gcd(right[i],A[N-i-1]))) for i in range(N-1)]
right.reverse()
max([gcd(a,b) for a,b in zip(left,right)])
Problem p03071 (python)

Fixed submission:
A,B = list(map(int,input().split()))
if A != B:
    ans = 2 * max(A,B) - 1
else:
    ans = 2 * A
print(ans)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
S=input()+"2"
_list=[]
if S[0]=="1":
    _list=[]
else:
    _list=[0]
cnt=1
for i in range(N):
    if S[i]==S[i+1]:
        cnt+=1
    else:
        _list.append(cnt)
        cnt=1
if S[-2]=="0":
    _list.append(0)
import itertools
__list=[0]+list(itertools.accumulate(_list))
C=len(__list)
K=min(C,K)
if C//2<=K:
    print(_list[0])
else:
    print(max([__list[2*i+2*K+1]-__list[2*i] for i in range((C+1)//2-K)]))
Problem p03074 (python)

Fixed submission:
N,K = list(map(int,input().split()))
S = [int(i) for i in list(input())]
S.append(2)

S2 = []
cnt = 1
for i in range(N):
    if S[i] != S[i+1]:
        S2.append([S[i],cnt])
        cnt = 1
    else:
        cnt += 1

if S2[0][0] == 0:
    S2 = [[1,0]] + S2
if S2[-1][0] == 0:
    S2.append([1,0])    
    
SUM = [0]
for i in range(len(S2)):
    SUM.append(SUM[i] + S2[i][1])
T = []
for i in range(0,max(1,len(SUM)//2-K),1):
    T.append(SUM[min(len(SUM)-1,2*(K+i)+1)]-SUM[2*i])
print(max(T))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
S=input()+"2"
_list=[]
if S[0]=="1":
    _list=[]
else:
    _list=[0]
cnt=1
for i in range(N):
    if S[i]==S[i+1]:
        cnt+=1
    else:
        _list.append(cnt)
        cnt=1
if S[-2]=="0":
    _list.append(0)
import itertools
__list=[0]+list(itertools.accumulate(_list))
C=len(__list)
K=min(C,K)
if C//2==K:
    print(_list[0])
else:
    print(max([__list[2*i+2*K+1]-__list[2*i] for i in range(C//2-K)]))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
S=input()+"2"
_list=[]
if S[0]=="1":
    _list=[]
else:
    _list=[0]
cnt=1
for i in range(N):
    if S[i]==S[i+1]:
        cnt+=1
    else:
        _list.append(cnt)
        cnt=1
if S[-2]=="0":
    _list.append(0)
import itertools
__list=[0]+list(itertools.accumulate(_list))
print(_list)
print(__list)
C=len(__list)
K=min(C,K)
if C//2==K:
    print(_list[0])
else:
    print(max([__list[2*i+2*K+1]-__list[2*i] for i in range(C//2-K)]))
Problem p03081 (python)

Fixed submission:
def main():
    n,q=map(int,input().split())
    s=input()
    td=[list(input().split()) for _ in [0]*q]
    l=0
    r=n-1
    for t,d in td[::-1]:
        if d=="R":
            if 0<=r<=n-1:
                if s[r]==t:
                    r-=1
            if n-1>=l>=1:
                if s[l-1]==t:
                    l-=1
        else:
            if n-1>=l>=0:
                if s[l]==t:
                    l+=1
            if 0<=r<=n-2:
                if s[r+1]==t:
                    r+=1
    print(max(r-l+1,0))
main()

Buggy submission (verdict: Runtime Error):
def main():
    n,q=map(int,input().split())
    s=input()
    td=[list(input().split()) for _ in [0]*q]
    l=0
    r=n-1
    for t,d in td[::-1]:
        if d=="R":
            if r<=n-1:
                if s[r]==t:
                    r-=1
            if l>=1:
                if s[l-1]==t:
                    l-=1
        else:
            if l>=0:
                if s[l]==t:
                    l+=1
            if r<=n-2:
                if s[r+1]==t:
                    r+=1
    print(r-l+1)
main()
Problem p03083 (python)

Fixed submission:
def main():
    b, w = map(int, input().split())
    mod = 10**9+7
    fact = [1, 1]
    for i in range(2, 2*(10**5)+5):
        fact.append(fact[-1]*i % mod)

    half = pow(2, mod-2, mod)

    def nCr(n, r, mod=10**9+7):
        return pow(fact[n-r]*fact[r] % mod, mod-2, mod)*fact[n] % mod

    h = 1

    A, B, C = 0, 1, 0
    for i in range(1, b+w+1):
        h = h*half % mod
        ans = B
        A = A*2 % mod
        B = B*2 % mod
        C = C*2 % mod
        if i-1 >= b:
            p = nCr(i-1, b)
            ans = (ans-p) % mod
            C = (C+p) % mod
            B = (B-p) % mod
        if i-w-1 >= 0:
            p = nCr(i-1, i-w-1)
            A = (A+p) % mod
            B = (B-p) % mod
        ans = (ans+A) % mod
        print(ans*h % mod)


main()

Buggy submission (verdict: Runtime Error):
def main():
    b, w = map(int, input().split())
    mod = 10**9+7
    fact = [1, 1]
    for i in range(2, 10**5):
        fact.append(fact[-1]*i % mod)

    half = pow(2, mod-2, mod)

    def nCr(n, r, mod=10**9+7):
        return pow(fact[n-r]*fact[r] % mod, mod-2, mod)*fact[n] % mod

    h = 1

    A, B, C = 0, 1, 0
    for i in range(1, b+w+1):
        h = h*half % mod
        ans = B
        A = A*2 % mod
        B = B*2 % mod
        C = C*2 % mod
        if i-1 >= b:
            p = nCr(i-1, b)
            ans = (ans-p) % mod
            C = (C+p) % mod
            B = (B-p) % mod
        if i-w-1 >= 0:
            p = nCr(i-1, i-w-1)
            A = (A+p) % mod
            B = (B-p) % mod
        ans = (ans+A) % mod
        print(ans*h % mod)


main()
Problem p03096 (python)

Fixed submission:
n=int(input())
c=[int(input()) for _ in [0]*n]
l=[-1]*200001
dp=[1]*n
l[c[0]]=0
mod=10**+9+7
for i in range(1,n):
	ci=c[i]
	if l[ci] not in [-1,i-1]:
		dp[i]=(dp[i-1]+dp[l[ci]])%mod
	else:
		dp[i]=dp[i-1]
	l[ci]=i
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
c=[int(input()) for _ in [0]*n]
l=[-1]*n
dp=[1]*n
l[c[0]]=0
mod=10**+9+7
for i in range(1,n):
	ci=c[i]
	if l[ci] not in [-1,i-1]:
		dp[i]=(dp[i-1]+dp[l[ci]])%mod
	else:
		dp[i]=dp[i-1]
	l[ci]=i
print(dp[n-1])
Problem p03106 (python)

Fixed submission:
a,b,k=map(int,input().split())
print([i for i in reversed(range(1,101)) if a%i==b%i==0][k-1])

Buggy submission (verdict: Runtime Error):
def main():
    a, b, k = map(int, input().split())
    from math import gcd
    g = gcd(a, b)

    def yakusuu(a):
        yakusuu = set()
        for i in range(1, int(a**0.5)+1):
            if a % i == 0:
                yakusuu.add(i)
                yakusuu.add(a//i)
        yakusuu = sorted(list(yakusuu))
        return yakusuu

    print(yakusuu(g)[::-1][k-1])


main()
Problem p03112 (python)

Fixed submission:
inf=10**11
A,B,Q=map(int,input().split())
s=[-inf]+[int(input()) for _ in range(A)]+[inf]
t=[-inf]+[int(input()) for _ in range(B)]+[inf]
x=[[i,int(input())] for i in range(Q)]

x.sort(key=lambda x:x[1])
i,s_i,t_i=0,0,0
ans=[]

for i in range(Q):
    while(1):
        if x[i][1]>=s[s_i]:
            s_i+=1
        else:
            break
    while(1):
        if x[i][1]>=t[t_i]:
            t_i+=1
        else:
            break
    ans.append([x[i][0],x[i][1],s[s_i-1],s[s_i],t[t_i-1],t[t_i]])
ans.sort(key=lambda x:x[0])
for i in range(Q):
    xx=ans[i][1]
    Nb_s0=ans[i][2]
    Nb_s1=ans[i][3]
    Nb_t0=ans[i][4]
    Nb_t1=ans[i][5]

    p1=abs(Nb_s0-xx)
    p2=abs(Nb_s1-xx)
    p3=abs(Nb_t0-xx)
    p4=abs(Nb_t1-xx)
    q1=abs(Nb_t0-Nb_s0)
    q2=abs(Nb_t0-Nb_s1)
    q3=abs(Nb_t1-Nb_s0)
    q4=abs(Nb_t1-Nb_s1)
    print(min(p1+q1,p2+q2,p1+q3,p2+q4,p3+q1,p4+q4,p3+q2,p4+q3))

Buggy submission (verdict: Runtime Error):
A,B,Q=map(int,input().split())
s=[int(input()) for _ in range(A)]
t=[int(input()) for _ in range(B)]

#二分探索関数
def bin_search(x,seq):
    a=0
    b=len(seq)-1
    for len(seq):
        center=((a+b)//2)
        if x>=seq[center]:
            a=center
        else:
            b=center
        if b-a<=1:
            break
    return seq[a],seq[b]

for i in range(Q):
    x=int(input())
    Nb_s0,Nb_s1=bin_search(x,s)
    Nb_t0,Nb_t1=bin_search(x,t)
    k1=abs(Nb_s0-x)+abs(Nb_t0-Nb_s0)
    k2=abs(Nb_s1-x)+abs(Nb_t0-Nb_s1)
    k3=abs(Nb_s0-x)+abs(Nb_t1-Nb_s0)
    k4=abs(Nb_s1-x)+abs(Nb_t1-Nb_s1)
    k5=abs(Nb_t0-x)+abs(Nb_t0-Nb_s0)
    k6=abs(Nb_t1-x)+abs(Nb_t1-Nb_s1)
    k7=abs(Nb_t0-x)+abs(Nb_t0-Nb_s1)
    k8=abs(Nb_t1-x)+abs(Nb_t1-Nb_s0)
    print(min(k1,k2,k3,k4,k5,k6,k7,k8))

Buggy submission (verdict: Runtime Error):
A,B,Q=map(int,input().split())
s=[int(input()) for _ in range(A)]
t=[int(input()) for _ in range(B)]

#二分探索関数
def bin_search(x,seq):
    width=[0,len(seq)-1]
    while(width[1]-width[0]>1):
        center=(sum(width)//2)
        if x>=seq[center]:
            width=[center,width[1]]
        else:
            width=[width[0],center]
if x<=seq[width[0]]:
    return [width[0],width[0]]
elif x>=seq[width[1]]:
    return [width[1],width[1]]
else:
    return width

for i in range(Q):
    x=int(input())
    Nb_s=bin_search(x,s)
    Nb_t=bin_search(x,t)
    Nb_s0=s[Nb_s[0]]
    Nb_s1=s[Nb_s[1]]
    Nb_t0=t[Nb_t[0]]
    Nb_t1=t[Nb_t[1]]

    k1=abs(Nb_s0-x)+abs(Nb_t0-Nb_s0)
    k2=abs(Nb_s1-x)+abs(Nb_t0-Nb_s1)
    k3=abs(Nb_s0-x)+abs(Nb_t1-Nb_s0)
    k4=abs(Nb_s1-x)+abs(Nb_t1-Nb_s1)
    k5=abs(Nb_t0-x)+abs(Nb_t0-Nb_s0)
    k6=abs(Nb_t1-x)+abs(Nb_t1-Nb_s1)
    k7=abs(Nb_t0-x)+abs(Nb_t0-Nb_s1)
    k8=abs(Nb_t1-x)+abs(Nb_t1-Nb_s0)
    print(min(k1,k2,k3,k4,k5,k6,k7,k8))
Problem p03155 (python)

Fixed submission:
N,H,W=[int(input()) for _ in range(3)]
print((N-H+1)*(N-W+1))

Buggy submission (verdict: Runtime Error):
N,H,W=[int(input()) in _ for range(3)]
print((N-H+1)*(N-W+1))
Problem p03240 (python)

Fixed submission:
import numpy as np
from functools import reduce

def dist(array,xyh):
    return (abs(array.real-xyh[0])+abs(array.imag-xyh[1])+xyh[2])

def dist2(array,xyh,dxyh):
    if xyh[2]>0:
        return dist(array,xyh) == dxyh
    else:
        return dist(array,xyh) >= dxyh

N=int(input())
xyh=sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[2],reverse=True)

a=np.arange(101)+np.arange(101).reshape(101,1)*1j
dxyh=dist(a,xyh[0])

ans=np.where(reduce(lambda a,b:a&b,[dist2(a,xyh[i],dxyh) for i in range(1,N)]) == True)
print(ans[1][0],ans[0][0],int(dxyh[ans[0][0],ans[1][0]]))

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

def dist(array,xyh):
    return (abs(array.real-xyh[0])+abs(array.imag-xyh[1])+xyh[2])

def dist2(array,xyh,dxyh):
    if xyh[2]>0:
        return dist(array,xyh) == dxyh
    else:
        return dist(array,xyh) <= dxyh

N=int(input())
xyh=sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[2],reverse=True)

a=np.arange(101)+np.arange(101).reshape(101,1)*1j
dxyh=dist(a,xyh[0])

ans=np.where(reduce(lambda a,b:a&b,[dist2(a,xyh[i],dxyh) for i in range(1,N)]) == True)
print(ans[1][0],ans[0][0],int(dxyh[ans[0][0],ans[1][0]]))

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

def dist(array,xyh):
    return abs(array.real-xyh[0])+abs(array.imag-xyh[1])+xyh[2]

N=int(input())
xyh=np.array([list(map(int,input().split())) for _ in range(N)])

a=np.arange(101)+np.arange(101).reshape(101,1)*1j
dxyh=dist(a,xyh[0])

ans=np.where(reduce(lambda a,b:a&b,[dist(a,xyh[i])==dxyh for i in range(1,N)]) == True)
print(ans[1][0],ans[0][0],int(dxyh[ans[0][0],ans[1][0]]))
Problem p03256 (python)

Fixed submission:
def main():
    from sys import stdin
    input = stdin.readline
    n, m = map(int, input().split())
    s = [i == "B" for i in input()]
    ab = [list(map(int, input().split())) for _ in [0]*m]
    g = [set() for _ in [0]*n]
    [g[a-1].add(b-1) for a, b in ab]
    [g[b-1].add(a-1) for a, b in ab]

    g2 = [[0, 0] for _ in [0]*n]

    for i in range(n):
        for j in g[i]:
            g2[i][s[j]] += 1

    ss = []
    for i, (j, k) in enumerate(g2):
        if (j == 0 and k > 0) or (j > 0 and k == 0):
            ss.append(i)

    while ss:
        i = ss.pop()
        c = s[i]
        for j in g[i]:
            if i != j:
                g[j].remove(i)
            g2[j][c] -= 1
            p, q = g2[j]
            if (p == 0 and q > 0) or (p > 0 and q == 0):
                ss.append(j)
        g[i] = set()

    for i in g:
        if len(i) > 0:
            print("Yes")
            return
    print("No")


main()

Buggy submission (verdict: Runtime Error):
def main():
    N, M = map(int, input().split())
    S = [i == "B" for i in input()]
    ab = [list(map(int, input().split())) for _ in [0]*M]
    graph = [set() for _ in [0]*N]
    [graph[a-1].add(b-1) for a, b in ab]
    [graph[b-1].add(a-1) for a, b in ab]

    status = [[0, 0] for _ in [0]*N]

    for i in range(N):
        for j in g[i]:
            status[i][S[j]] += 1

    que = []
    for i, (p, q) in enumerate(status):
        if (p == 0) ^ (q == 0):
            que.append(i)

    while que:
        i = que.pop()
        c = S[i]
        for j in graph[i]:
            if i != j:
                graph[j].remove(i)
            status[j][c] -= 1
            p, q = status[j]
            if (p == 0) ^ (q == 0):
                que.append(j)
        g[i] = set()

    for i in g:
        if i:
            print("Yes")
            return
    print("No")


main()
Problem p03262 (python)

Fixed submission:
N,X=map(int,input().split())
x=list(map(int,input().split()))+[X]

from fractions import gcd

x=[x[i+1]-x[i] for i in range(N)]

ans=0
for i in range(N):
    ans=gcd(ans,x[i])
print(abs(ans))

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
x=list(map(int,input().split()))+[X]

from math import gcd

x=[x[i+1]-x[i] for i in range(N)]

ans=0
for i in range(N):
    ans=gcd(ans,x[i])
print(abs(ans))

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
x=list(map(int,input().split()))+[X]

from fractions import gcd

x=[x[i+1]-x[i] for i in range(N)]

def gcd_many(_list):
    if len(_list)==1:
        return abs(_list[0])
    elif len(_list)==2:
        return gcd(_list[0],_list[1])
    else:
        return gcd(_list[0],gcd_many(_list[1:]))
        
print(abs(gcd_many(x)))

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
x=list(map(int,input().split()))+[X]

from fractions import gcd

x=[x[i+1]-x[i] for i in range(N)]

def gcd_many(_list):
    if len(_list)==1:
        return abs(_list[0])
    elif len(_list)==2:
        return gcd(_list[0],_list[1])
    else:
        return gcd(_list[0],gcd_many(_list[1:]))
        
print(gcd_many(x))

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
x=list(map(int,input().split()))+[X]

from fractions import gcd

x=[x[i+1]-x[i] for i in range(N)]

def gcd_many(_list):
    if len(_list)==2:
        return gcd(_list[0],_list[1])
    else:
        return gcd(_list[0],gcd_many(_list[1:]))
        
print(gcd_many(x))
Problem p03302 (python)

Fixed submission:
a,b=map(int,input().split())
if a+b==15:
  print("+")
elif a*b==15:
  print("*")
else:
  print("x")

Buggy submission (verdict: Runtime Error):
def main():
    from sys import stdin
    input = stdin.readline
    import numpy as np
    import scipy.sparse as sp

    n, m, s, t = map(int, input().split())
    uvab = np.array([list(map(int, input().split())) for _ in [0]*m])

    data = np.append(uvab[:, 2], uvab[:, 2])
    row = np.append(uvab[:, 0], uvab[:, 1]) - 1
    col = np.append(uvab[:, 1], uvab[:, 0]) - 1

    matrix = sp.csr_matrix(
        (data, (row, col)), shape=(n, n), dtype=np.int32)
    yen = sp.csgraph.dijkstra(matrix, indices=s-1)

    data = np.append(uvab[:, 3], uvab[:, 3])
    matrix = sp.csr_matrix(
        (data, (row, col)), shape=(n, n), dtype=np.int32)
    snk = sp.csgraph.dijkstra(matrix, indices=t-1)

    cost = yen+snk
    m = cost[-1]
    for i in range(n-1, -1, -1):
        m = min(cost[i], m)
        cost[i] = m

    cost = 10**15-cost

    for i in cost:
        print(int(i))


main()

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
if a+b==15:
  print("+")
elif a*b==15:
  print("*")
else:
  print("x")
Problem p03324 (python)

Fixed submission:
D,N=map(int,input().split())
if N==100:
  N=101
print((100**D)*N)

Buggy submission (verdict: Runtime Error):
D,N=map(int,input())
if N==100:
  N=101
print((100**D)*N)
Problem p03370 (python)

Fixed submission:
N,X=map(int,input().split())
m=[int(input()) for _ in range(N)]
print(N+(X-sum(m))//min(m))

Buggy submission (verdict: Runtime Error):
N,X=map(int,input())
m=[int(input()) for _ in range(N)]
print(N+(X-sum(m)//min(m)))

Buggy submission (verdict: Runtime Error):
N,X=map(int,input())
m=[int(input()) for _ in range(N)]
print(N+(X-sum(m))//min(m))
Problem p03388 (python)

Fixed submission:
def main():
    n = int(input())
    ab = [list(map(int, input().split())) for _ in [0]*n]
    for a, b in ab:
        a, b = min(a, b), max(a, b)
        s = (a*b-1)**0.5
        s_int = int(s)
        if a*b-1 > 1000:
            for i in range(s_int-10, s_int+10):
                if i*i > a*b-1:
                    s_int = i - 1
                    break
        if a == b:
            ans = 2*s_int
        elif (a*b-1)//s_int == s_int:
            ans = 2*s_int-2
        else:
            ans = 2*s_int-1
        print(ans)


main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    ab = [list(map(int, input().split())) for _ in [0]*n]
    for a, b in ab:
        a, b = min(a, b), max(a, b)
        s = (a*b-1)**0.5
        s_int = int(s)
        if (a*b-1)//s_int == s_int:
            ans = 2*s_int-2
        elif a == b:
            ans = 2*s_int
        else:
            ans = 2*s_int-1
        print(ans)


main()
Problem p03407 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c = list(map(int,input()))
if a + b < c:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
a,b,c = list(map(int,input()))
if a + b <= c:
  print("No")
else:
  print("Yes")
Problem p03412 (python)

Fixed submission:
def main():
    from bisect import bisect_right as br
    n = int(input())
    a = sorted(list(map(int, input().split())))
    b = sorted(list(map(int, input().split())), reverse=True)
    m = n % 2
    xor = 0
    for i in b:
        xor ^= i
    for i in range(n):
        b[i] = 2**28 - b[i]
    ans = 0
    for loop in range(28, -1, -1):
        j = pow(2, loop)
        k = (xor & j) // j
        temp = br(b, j-1)
        for i in range(temp, n):
            b[i] -= j
        b.sort()
        temp = br(a, j-1)
        for i in a[:temp]:
            k += (i & j) // j
        for i in range(temp, n):
            k += (a[i] & j) // j
            a[i] -= j
        x = (k+br(b, 0))*m % 2
        a.sort()
        l = 0
        for i in a:
            while l < n:
                if i >= b[l]:
                    l += 1
                else:
                    break
            x += l % 2
        ans += (x % 2)*j
    print(ans)


main()

Buggy submission (verdict: Runtime Error):
def main():
    from bisect import bisect_right as br
    n = int(input())
    a = sorted(list(map(int, input().split())))
    b = sorted(list(map(int, input().split())))
    #n = 10000 #
    #a = [i+1 for i in range(n)] #
    #b = [2*i+2 for i in range(n)] #
    m = n % 2
    xor = 0
    for i in b:
        xor ^= i
    for i in range(n):
        b[i] = -b[i]

    ans = 0
    for loop in range(28, -1, -1):
        j = 2**loop
        k = (xor & j) // j
        for i in range(i):
            b[i] = b[i] % j
        b.sort()
        x = k*m % 2
        b0 = br(b, 0)
        for i in a:
            k2 = m * (i & j) // j
            x += (k2 + br(b, i % j) - b0) % 2
        x %= 2
        ans += x*j
    print(ans)


main()
Problem p03455 (python)

Fixed submission:
a,b = list(map(int,input().split()))
if a*b %2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a,b = [int(input()) for _ in range(2)]
if a*b %2 == 0:
  print("Even")
else:
  print("Odd")
Problem p03501 (python)

Fixed submission:
N,A,B = list(map(int,input().split()))
print(min([N*A,B]))

Buggy submission (verdict: Runtime Error):
N,A,B = list(map(int,input().split()))
print(min([N*A,B])