Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#074-C
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
w1,w2,s1,s2,c,lim=IL()
l=[]
for i in range(31):
    for j in range(31):
        w=w1*i*100+w2*j*100
        if w<lim:
            l.append(w)
ans_c=0
for w in l:
    maxs=min(c*w//100,lim-w)
    maxs1=maxs//s1+1
    maxs2=maxs//s2+1
    for i in range(maxs1+1):
        for j in range(maxs2+1):
            s=s1*i+s2*j
            if s+w!=0:
                if s+w<=lim and s<=maxs and ans_c<100*s/(s+w):
                    ans_c=100*s/(s+w)
                    ans=[s+w,s]
print(ans[0],ans[1])

Fixed submission:
#074-C
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
w1,w2,s1,s2,c,lim=IL()
l=[]
for i in range(31):
    for j in range(31):
        w=w1*i*100+w2*j*100
        if w<lim:
            l.append(w)
ans_c=0
ans=[100*w1,0]
for w in l:
    maxs=min(c*w//100,lim-w)
    maxs1=maxs//s1+1
    maxs2=maxs//s2+1
    for i in range(maxs1+1):
        for j in range(maxs2+1):
            s=s1*i+s2*j
            if s+w!=0:
                if s+w<=lim and s<=maxs and ans_c<100*s/(s+w):
                    ans_c=100*s/(s+w)
                    ans=[s+w,s]
print(ans[0],ans[1])
Buggy python submission (verdict: Runtime Error):
#073-C
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
n=I()
a=[]
for i in range(n):
    t=I()
    a.append(t)
b=list[set(a)]
c={}
for i in b:
    c[i]=0
for i in a:
    c[a]+=1
for i in c.keys():
    if c[i]%2==1:
        cnt+=1
print(cnt)

Fixed submission:
#073-C
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
n=I()
a=[]
for i in range(n):
    t=I()
    a.append(t)
b=list(set(a))
c={}
cnt=0
for i in b:
    c[i]=0
for i in a:
    c[i]+=1
for i in c.keys():
    if c[i]%2==1:
        cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
#072-C
n=I()
a=IL()
cnt=[0 for i in range(pow(10,5))]
for i in range(n):
    cnt[a[i]]+=1
m=0
for i in range(2,pow(10,5)):
    m=max(cnt[i]+cnt[i-1]+cnt[i-2],m)
print(m)

Fixed submission:
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
n=I()
a=IL()
cnt=[0 for i in range(pow(10,5))]
for i in range(n):
    cnt[a[i]]+=1
m=0
for i in range(2,pow(10,5)):
    m=max(cnt[i]+cnt[i-1]+cnt[i-2],m)
print(m)
Buggy python submission (verdict: Runtime Error):
#ABC070-C TLE
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()

def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)

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

n=I()
t=[]
ans=1
for i in range(n):
    tmp=I()
    ans=lcm(ans,tmp)
print(int(ans))

Fixed submission:
#ABC070-C TLE
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()

def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)

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

n=I()
t=[]
ans=1
for i in range(n):
    tmp=I()
    ans=lcm(ans,tmp)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#ABC070-C
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()

def fctr1(n): #[[素因数,数]]を出力
    f=[]
    c=0
    r=int(n**0.5)
    for i in range(2,r+2):
        while n%i==0:
            c+=1
            n=n//i
        if c!=0:
            f.append([i,c])
            c=0
    if n!=1:
        f.append([n,1])
    return f

n=I()
t=[]
elm=dict()
for i in range(n):
    tmp=I()
    t.append(tmp)
for i in range(n):
    f=fctr1(t[i])
    for j in f:
        if j[0] in elm:
            elm[j[0]]=max(elm[j[0]],j[1])
        else:
            elm[j[0]]=j[1]
ans=1
for i in elm:
    ans*=pow(i,elm[i])
print(ans)

Fixed submission:
#ABC070-C TLE
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()

def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)

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

n=I()
t=[]
ans=1
for i in range(n):
    tmp=I()
    ans=lcm(ans,tmp)
print(ans)
Buggy python submission (verdict: Runtime Error):
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()

n=I()
nl=[[] for i in range(n)]
used=[False for i in range(n)]
for i in range(n-1):
    a,b,c=IL()
    nl[a-1].append([b-1,c])
    nl[b-1].append([a-1,c])
d=[None for i in range(n)]
def dfs(now,pre,dis):
    used[now]=True
    d[now]=dis
    for i in nl[now]:
        if i[0]!=pre and not used[i[0]]:
            dfs(i[0],now,dis+i[1])
    
    return
q,k=IL()
dfs(k-1,-1,0)
for i in range(q):
    x,y=IL()
    print(d[x-1]+d[y-1])

Fixed submission:
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
import sys
sys.setrecursionlimit(10 ** 6)
n=I()
nl=[[] for i in range(n)]
used=[False for i in range(n)]
for i in range(n-1):
    a,b,c=IL()
    nl[a-1].append([b-1,c])
    nl[b-1].append([a-1,c])
d=[None for i in range(n)]
def dfs(now,pre,dis):
    used[now]=True
    d[now]=dis
    for i in nl[now]:
        if i[0]!=pre and not used[i[0]]:
            dfs(i[0],now,dis+i[1])
    
    return
q,k=IL()
dfs(k-1,-1,0)
for i in range(q):
    x,y=IL()
    print(d[x-1]+d[y-1])

Buggy python submission (verdict: Time Limit Exceeded):
#070-D
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()

#ベルマンフォード法
#E,vはedge、vertexの数
v=I()
E=v-1
e=[]
for i in range(E): #eの各要素は[始点,終点,コスト]
    f,t,c=map(int,input().split())
    e.append([f-1,t-1,c])
    e.append([t-1,f-1,c])

def sp(s,e): #sは始点、dに各頂点への最短距離が格納される
    d=[None for i in range(v)]
    for i in range(v):
        d[i]=float('INF')
    d[s]=0
    
    while True:
    
        update=False
        for i in range(2*E):
            
            if d[e[i][0]]!=float('INF') and d[e[i][1]]>d[e[i][0]]+e[i][2]:
                d[e[i][1]]=d[e[i][0]]+e[i][2]
                update=True
                
        
        if update==False:
            break
         
    return d
            
q,k=IL()
d=sp(k-1,e)
for i in range(q):
    x,y=IL()
    print(d[x-1]+d[y-1])

Fixed submission:
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
import sys
sys.setrecursionlimit(10 ** 6)
n=I()
nl=[[] for i in range(n)]
used=[False for i in range(n)]
for i in range(n-1):
    a,b,c=IL()
    nl[a-1].append([b-1,c])
    nl[b-1].append([a-1,c])
d=[None for i in range(n)]
def dfs(now,pre,dis):
    used[now]=True
    d[now]=dis
    for i in nl[now]:
        if i[0]!=pre and not used[i[0]]:
            dfs(i[0],now,dis+i[1])
    
    return
q,k=IL()
dfs(k-1,-1,0)
for i in range(q):
    x,y=IL()
    print(d[x-1]+d[y-1])
Buggy python submission (verdict: Runtime Error):
import numpy as np
n,m=map(int,input().split())
nextmatrix=np.zeros((n,n))
for i in range(m):
    a,b=map(int,input().split())
    nextmatrix[a-1][b-1]=1
    nextmatrix[b-1][a-1]=1
nextmatrix2=nextmatrix.dot(nextmatrix)
if nextmatrix2[0][n-1]==0:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")

Fixed submission:
#068-C
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()

n,m=IL()
nl=[[] for i in range(n)]
for i in range(m):
    a,b=IL()
    nl[a-1].append(b-1)
for i in nl[0]:
    if n-1 in nl[i]:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

Buggy python submission (verdict: Runtime Error):
#068-C
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
import numpy as np
n,m=IL()
nm=np.zeros((n,n))
for i in range(m):
    a,b=IL()
    nm[a-1][b-1]=1
    nm[b-1][a-1]=1
nm=nm.dot(nm)
if nm[0][n-1]==0:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")

Fixed submission:
#068-C
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()

n,m=IL()
nl=[[] for i in range(n)]
for i in range(m):
    a,b=IL()
    nl[a-1].append(b-1)
for i in nl[0]:
    if n-1 in nl[i]:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
#068-C
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
import numpy as np
n,m=IL()
nm=[[0 for i in range(n)] for j in range(n)]
for i in range(m):
    a,b=IL()
    nm[a-1][b-1]=1
    nm[b-1][a-1]=1
nm=np.array(nm)
nm=nm.dot(nm)
if nm[0][n-1]==0:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")

Fixed submission:
#068-C
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()

n,m=IL()
nl=[[] for i in range(n)]
for i in range(m):
    a,b=IL()
    nl[a-1].append(b-1)
for i in nl[0]:
    if n-1 in nl[i]:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Time Limit Exceeded):
#066-C
n=int(input())
a=list(map(int,input().split()))
b=[]
if n%2==0:
    for i in range(n):
        if i%2==0:
            b=b+[a[i]]
        else:
            b=[a[i]]+b
else:
     for i in range(n):
        if i%2==1:
            b=b+[a[i]]
        else:
            b=[a[i]]+b
for i in range(n):
    print(b[i],end=" ")
print()

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a1=[]
a2=[]
for i in range(n):
    if i%2==0:
        a1.append(a[i])
    else:
        a2.append(a[i])
if n%2==0:
    a2.reverse()
    b=a2+a1
else:
    a1.reverse()
    b=a1+a2
for i in range(n):
    print(b[i],end=" ")
print()
Buggy python submission (verdict: Time Limit Exceeded):
import math
n,a,b=map(int,input().split())
h=[]
for i in range(n):
    h.append(int(input()))
def sten(t):
    dh=[]
    for i in range(n):
        if h[i]-t*b>0:
            dh.append(h[i]-t*b)
    aan=0
    for i in range(len(dh)):
        aan+=math.ceil(dh[i]/(a-b))
    if aan<=t:
        return True
    else:
        return False
i=1
while True:
    if sten(i):
        print(i)
        break
    else:
        i+=1

Fixed submission:
import math
n,a,b=map(int,input().split())
h=[]
for i in range(n):
    h.append(int(input()))
def sten(t):
    dh=[]
    for i in range(n):
        if h[i]-t*b>0:
            dh.append(h[i]-t*b)
    aan=0
    for i in range(len(dh)):
        aan+=math.ceil(dh[i]/(a-b))
    if aan<=t:
        return True
    else:
        return False

left = 0
right = int(1e9)
while left < right:
    center = (left + right) // 2
    if sten(center):
        right = center
    else:
        left = center + 1
print(left)

Buggy python submission (verdict: Time Limit Exceeded):
import math
n,a,b=map(int,input().split())
h=[]
for i in range(n):
    h.append(int(input()))
def sten(t):
    dh=[]
    for i in range(n):
        if h[i]-t*b>0:
            dh.append(h[i]-t*b)
    aan=0
    for i in range(len(dh)):
        aan+=math.ceil(dh[i]/(a-b))
    if aan<=t:
        return True
    else:
        return False
i=1
while True:
    if sten(i):
        print(i)
        break
    else:
        i+=1

Fixed submission:
import math
n,a,b=map(int,input().split())
h=[]
for i in range(n):
    h.append(int(input()))
def sten(t):
    dh=[]
    for i in range(n):
        if h[i]-t*b>0:
            dh.append(h[i]-t*b)
    aan=0
    for i in range(len(dh)):
        aan+=math.ceil(dh[i]/(a-b))
    if aan<=t:
        return True
    else:
        return False

left = 0
right = int(1e9)
while left < right:
    center = (left + right) // 2
    if sten(center):
        right = center
    else:
        left = center + 1
print(left)
Buggy python submission (verdict: Time Limit Exceeded):
import heapq
import copy
n=int(input())
a=list(map(int,input().split()))
m1=min(a[:n])
s1=sum(a[:n])
ca=copy.deepcopy(a)
f=ca[:n]
heapq.heapify(f)
fs=sum(ca[:n])
t=ca[n:]
ls=sum(heapq.nsmallest(n,t))
ans=fs-ls
for i in range(n,2*n):
    heapq.heappush(f,a[i])
    fs=fs+a[i]-heapq.heappop(f)
    t=a[i+1:]
    ls=sum(heapq.nsmallest(n,t))
    ans=max(ans,fs-ls)
print(ans)

Fixed submission:
import heapq
import copy
n=int(input())
a=list(map(int,input().split()))
ca=copy.deepcopy(a)
f=ca[:n]
heapq.heapify(f)
fs=sum(f)
fsl=[0 for i in range(n+1)]
fsl[0]=fs
for i in range(n,2*n):
    heapq.heappush(f,a[i])
    fs=fs+a[i]-heapq.heappop(f)
    fsl[i-n+1]=fs
l=list(map(lambda x:-x,ca[2*n:]))
heapq.heapify(l)
ls=sum(l)
lsl=[0 for i in range(n+1)]
lsl[-1]=ls
for i in range(n,2*n):
    heapq.heappush(l,-a[3*n-i-1])
    ls=ls-a[3*n-i-1]-heapq.heappop(l)
    lsl[2*n-i-1]=ls
ans=-float('inf')
for i in range(n+1):
    ans=max(ans,fsl[i]+lsl[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
#061-D
#v,Eは、頂点(vertex),辺(edge)の数
v,E=map(int,input().split())
e=[]
for i in range(E): #eの各要素は[始点,終点,コスト]
    f,t,c=map(int,input().split())
    e.append([f-1,t-1,-c])
d=[None for i in range(v)]
def lp(s,g): #sは始点、dに各頂点への最短距離が格納される
    for i in range(v):
        d[i]=float('INF')
    d[s]=0
    c=0
    while c<v+1:
        update=False
        for i in range(E):
            if d[e[i][0]]!=float('INF') and d[e[i][1]]>d[e[i][0]]+e[i][2]:
                d[e[i][1]]=d[e[i][0]]+e[i][2]
                update=True
        if update==False:
            break
        c+=1
    if c==v+1:
        print('inf')
    else:
        print(-d[g])
lp(0,2)

Fixed submission:
#061-D
#v,Eは、頂点(vertex),辺(edge)の数
v,E=map(int,input().split())
e=[]
for i in range(E): #eの各要素は[始点,終点,コスト]
    f,t,c=map(int,input().split())
    e.append([f-1,t-1,c])
d=[None for i in range(v)]
for i in range(v):
    d[i]=-float('INF')
d[0]=0
for i in range(v-1):
    update=False
    for i in range(E):
        if d[e[i][0]]!=-float('INF') and d[e[i][1]]<d[e[i][0]]+e[i][2]:
            d[e[i][1]]=d[e[i][0]]+e[i][2]
            update=True
    if not update:
        break
ans=d[v-1]
for i in range(E):
    if d[e[i][0]]!=-float('INF') and d[e[i][1]]<d[e[i][0]]+e[i][2]:
        d[e[i][1]]=d[e[i][0]]+e[i][2]
print(ans if ans==d[v-1] else 'inf')

Buggy python submission (verdict: Runtime Error):
#061-D
#v,Eは、頂点(vertex),辺(edge)の数
v,E=map(int,input().split())
e=[]
for i in range(E): #eの各要素は[始点,終点,コスト]
    f,t,c=map(int,input().split())
    e.append([f-1,t-1,-c])
d=[None for i in range(v)]
def lp(s,g): #sは始点、dに各頂点への最短距離が格納される
    for i in range(v):
        d[i]=float('INF')
    d[s]=0
    c=0
    while c<v+1:
        update=False
        for i in range(E):
            if d[e[i][0]]!=float('INF') and d[e[i][1]]>d[e[i][0]]+e[i][2]:
                d[e[i][1]]=d[e[i][0]]+e[i][2]
                update=True
        if update==False:
            break
    if c==v+1:
        print('inf')
    else:
        print(-d[g])
lp(0,2)

Fixed submission:
#061-D
#v,Eは、頂点(vertex),辺(edge)の数
v,E=map(int,input().split())
e=[]
for i in range(E): #eの各要素は[始点,終点,コスト]
    f,t,c=map(int,input().split())
    e.append([f-1,t-1,c])
d=[None for i in range(v)]
for i in range(v):
    d[i]=-float('INF')
d[0]=0
for i in range(v-1):
    update=False
    for i in range(E):
        if d[e[i][0]]!=-float('INF') and d[e[i][1]]<d[e[i][0]]+e[i][2]:
            d[e[i][1]]=d[e[i][0]]+e[i][2]
            update=True
    if not update:
        break
ans=d[v-1]
for i in range(E):
    if d[e[i][0]]!=-float('INF') and d[e[i][1]]<d[e[i][0]]+e[i][2]:
        d[e[i][1]]=d[e[i][0]]+e[i][2]
print(ans if ans==d[v-1] else 'inf')
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
sx=0
sy=0
for i in range(n):
    sx+=i*x[i]-(n-i-1)*x[i]
for i in range(n):
    sy+=i*y[i]-(n-i-1)*y[i]
print(sx*sy)

Fixed submission:
#058-D
n,m=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
sx=0
sy=0
for i in range(n):
    sx+=i*x[i]-(n-i-1)*x[i]
for i in range(m):
    sy+=i*y[i]-(m-i-1)*y[i]
sx=sx%(10**9+7)
sy=sy%(10**9+7)
ans=sx*sy%(10**9+7)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=input()
if a=='H':
    if b=='H':
        print('H')
    else:
        print('D')
else:
    if b=='H':
        print('D')
    else:
        print('H')

Fixed submission:
a,b=input().split()
if a=='H':
    if b=='H':
        print('H')
    else:
        print('D')
else:
    if b=='H':
        print('D')
    else:
        print('H')
Buggy python submission (verdict: Time Limit Exceeded):
n,a=map(int,input().split())
x=list(map(int,input().split()))
X=max(max(x),a)

dp=[[[None for i in range(n*X+1)] for h in range(n+1)] for g 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 x[j-1]>s:
                dp[j][k][s]=dp[j-1][k][s]
            elif j>=1 and k>=1 and x[j-1]<=s:
                dp[j][k][s]=dp[j-1][k][s]+dp[j-1][k-1][s-x[j-1]]
            else:
                dp[j][k][s]=0
                
ans=0
for i in range(1,n+1):
    ans+=dp[n][i][i*a]

print(ans)

Fixed submission:
n,a=map(int,input().split())
x=list(map(int,input().split()))
X=max(max(x),a)
y=[]
for i in x:
    y.append(i-a)
dp=[[None for i in range(2*n*X+1)] for h 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-1]<0 or t-y[j-1]>2*n*X):
                dp[j][t]=dp[j-1][t]
            elif j>=1 and t-y[j-1]>=0 and t-y[j-1]<=2*n*X:
                dp[j][t]=dp[j-1][t]+dp[j-1][t-y[j-1]]
            else:
                dp[j][t]=0
                
print(dp[n][n*X]-1)
Buggy python submission (verdict: Runtime Error):
w=list(input())
for i in range(len(w)):
    if w[i]==w[i+1] or w[i]==w[i+2]:
        print("{} {}".format(i+1,i+3))
        break
else:
    print("{} {}".format(-1,-1))

Fixed submission:
w=list(input())
l=len(w)
w.append(0) #そのままだとforループの最後でw[i+2]がout of rangeになる
for i in range(l-1):
    if w[i]==w[i+2]:
        print("{} {}".format(i+1,i+3))
        break
    elif w[i]==w[i+1]:
        print("{} {}".format(i+1,i+2))
        break
else:
    print("{} {}".format(-1,-1))
Buggy python submission (verdict: Runtime Error):
from scipy.special import comb
h,w,a,b=map(int,input().split())
s=0
for i in range(1,h-a+1):
    s=s+comb(i-2+b,i-1,exact=True)*comb(w-b-1+h-i,w-b-1,exact=True)
print(s%(10**9+7))

Fixed submission:
h,w,a,b=map(int,input().split())
mod=10**9+7
fuc=[1]
for i in range(1,h+w):
    e=fuc[i-1]*i
    fuc.append(e%mod)

def com(n,k):
    com=(fuc[n]%mod)*pow(fuc[k],mod-2,mod)*pow(fuc[n-k],mod-2,mod)
    return com

s=0
for i in range(1,h-a+1):
    s+=com(i-2+b,i-1)*com(w-b-1+h-i,w-b-1)
print(s%mod)
Buggy python submission (verdict: Runtime Error):
t,x = list(map(int,input().strip()))

num = t / x

print(float(num))

Fixed submission:
t,x = list(map(int,input().split()))
print(t/x)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())

if n%500 =< a:
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())
a = int(input())


if n % 500 <= a:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
 
ans = a + b
if ans < 24:
    print(s)
else:
    print(s - 24)

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

if ans < 24:
    print(ans)
else:
    print(ans - 24)

Buggy python submission (verdict: Runtime Error):
a,b = int(input().split())
ans = a + b
if ans > 24:
  print(ans - 24)
else:
  print(ans)

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

if ans < 24:
    print(ans)
else:
    print(ans - 24)
Buggy python submission (verdict: Runtime Error):
n= input()

n_list=list(n)

a=(n_list.count(n_list[0]))
b=(n_list.count(n_list[1]))
c=(n_list.count(n_list[2]))
d=(n_list.count(n_list[3]))
print(a,b,c,d)
if (a==3 and c==and b==2 and d==2):
    print("Yes")
else:
    print("No") 

Fixed submission:
n= input()

n_list=list(n)

a=(n_list.count(n_list[0]))
b=(n_list.count(n_list[1]))
c=(n_list.count(n_list[2]))
d=(n_list.count(n_list[3]))

if a==2:
    if b==2:
        if c==2:
            if d==2:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a=>b:
  print('10')
else:
  print('0')

Fixed submission:
a, b = map(int, input().split())
if a >= b:
  print('10')
else:
  print('0')

Buggy python submission (verdict: Runtime Error):
a,b=int(input().split)
if a=>b:
  print('10')
else:
  print('0')

Fixed submission:
a, b = map(int, input().split())
if a >= b:
  print('10')
else:
  print('0')
Buggy python submission (verdict: Runtime Error):
 (int(i) for i in input().split())  
if a<= 13:
  sum = b
elif 6<= a <= 12:
  sum = b/2
elif 5>=a:
  sum = 0
print(sum)
 

Fixed submission:
a,b = (int(i) for i in input().split())  
sum = b
if 13<= a:
  sum = b
if 6<= a <= 12:
  sum = b/2
if 5>=a:
  sum = 0
print(int(sum))

Buggy python submission (verdict: Runtime Error):
a,b = int(input().split())
if a<= 13:
  sum = b
elif 6<= a <= 12:
  sum = b/2
elif 5>=a:
  sum = 0
print(sum)
 

Fixed submission:
a,b = (int(i) for i in input().split())  
sum = b
if 13<= a:
  sum = b
if 6<= a <= 12:
  sum = b/2
if 5>=a:
  sum = 0
print(int(sum))
Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

N = int(input())
A = input().split(' ')

an = np.array(A, dtype=np.int64)

M = 0
b = []

for i in range(1,N):
   chk_num = int(N/(i))

   if(chk_num<2):
      continue

   ball = 0
   for j in range(1,chk_num):
      c = i * j
      ball += an[j]
   M += 1
   b.append((ball+1)%2)


print(M)
print(*b)


Fixed submission:
r = int(input())

s = 3*r*r

print(s)
Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

N = int(input())

A = np.empty(N)
for i in range(N):
   A[i] = int(input())


max_a = np.max(A)
max_i = np.argmax(A)

for i in range(N):
   if(i == max_i):
      max_n0 = np.max(A[0:i-1])
      max_n1 = np.max(A[i+1,N-1])
      if(max_n0 > max_n1):
         print(max_n0)
      else:
         print(max_n1)
   else:
      print(max_a)


Fixed submission:
import numpy as np
import math

N = int(input())

A = np.empty(N)
for i in range(N):
   A[i] = int(input())


max_a = np.max(A)
max_i = np.argmax(A)

for i in range(N):
   if(i == max_i):
      aa = np.sort(A)
      print(int(aa[-2]))
   else:
      print(int(max_a))

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

N = int(input())

A = np.empty(N)
for i in range(N):
   A[i] = int(input())


max_a = np.max(A)
max_i = np.argmax(A)

for i in range(N):

   if(i == max_i):
      max_n0 = np.max(A[0:i-1)
      max_n1 = np.max(A[i+1,N-1)
      if(max_n0 > max_n1):
         print(max_n0)
      else:
         print(max_n1)
   else:
      print(max_a)


Fixed submission:
import numpy as np
import math

N = int(input())

A = np.empty(N)
for i in range(N):
   A[i] = int(input())


max_a = np.max(A)
max_i = np.argmax(A)

for i in range(N):
   if(i == max_i):
      aa = np.sort(A)
      print(int(aa[-2]))
   else:
      print(int(max_a))