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

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=[0 for i in range(100001)]
for i in range(n):
    ans[a[i]-1]+=1
tmp=0
for i in range(100001):
    tt=(i+1)*ans[i]
    tmp+=tt
q=int(input())
for i in range(q):
    b,c=map(int,input().split())
    tt=-ans[b-1]*b+ans[b-1]*c
    ans[c-1]+=ans[b-1]
    ans[b-1]=0
    tmp+=tt
    print(tmp)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=[0 for i in range(10001)]
for i in range(n):
    ans[a[i]-1]+=1
tmp=0
for i in range(10001):
    tt=(i+1)*ans[i]
    tmp+=tt
q=int(input())
for i in range(q):
    b,c=map(int,input().split())
    tt=-ans[b-1]*b+ans[b-1]*c
    ans[c-1]+=ans[b-1]
    ans[b-1]=0
    tmp+=tt
    print(tmp)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=[0 for i in range(10000)]
for i in range(n):
    ans[a[i]-1]+=1
tmp=0
for i in range(10000):
    tt=(i+1)*ans[i]
    tmp+=tt
q=int(input())
for i in range(q):
    b,c=map(int,input().split())
    tt=-ans[b-1]*b+ans[b-1]*c
    ans[c-1]+=ans[b-1]
    ans[b-1]=0
    tmp+=tt
    print(tmp)
Problem p02642 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.sort()
dp=[0]*(a[-1]+1)

for i in a :
    dp[i]+=1

for i in a :
    if dp[i] :
        for j in range(i*2,a[-1]+1,i) :
            dp[j]=0

print(dp.count(1))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.sort()
tmp=set()
onaji=set()
if a[0]!=a[1]:
    tmp.add(a[0])
for i in range(1,n-1):
    flg=True
    if a[i]==a[i+1] or a[i]==a[i-1]:
        flg=False
    for j in tmp:
        if a[i]%j==0:
            flg=False
    if flg:
        tmp.add(a[i])
flg=True
if a[n-1]==a[n-2]:
    flg=False
for i in tmp:
    if a[n-1]%i==0:
        flg=False
if flg:
    tmp.add(a[n-1])
print(len(tmp))
Problem p02646 (python)

Fixed submission:
import sys
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if a==b:
    print("YES")
    sys.exit()
if a<b and a+v*t>=b+w*t:
    print("YES")
elif a>b and a-v*t<=b-w*t:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import sys
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if a=b:
    print("YES")
    sys.exit()
if a<b and a+v*t>=b+w*t:
    print("YES")
elif a>b and a-v*t<b-w*t:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if a=b:
    print("YES")
    sys.exit()
if a<b and a+v*t>=b+w*t:
    print("YES")
elif a>b and a-v*t<b-w*t:
    print("YES")
else:
    print("NO")
Problem p02660 (python)

Fixed submission:
import sys
n=int(input())
if n==1:
    print(0)
    sys.exit()
def f(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
tmp=f(n)
ans=0
for i in tmp:
    dd=i[1]
    tt=1
    while dd>0:
        if dd-tt>=0:
            dd-=tt
            tt+=1
            ans+=1
        else:
            break
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
if n==1:
    print(0)
    sys.exit()
def f(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
tmp=f(n)
ans=0
for i in tmp:
    dd=i[1]
    tt=1
    while dd>0:
        if dd-tt>=0:
            dd-=tt
            tt+=1
            ans+=1
        else:
            break
print(ans)=0:
            dd-=tt
            tt+=1
            ans+=1
print(ans)
Problem p02684 (python)

Fixed submission:
n, k = map(int, input().split())
a = [0]+list(map(int, input().split()))

num = 1
li = [1]
flag = [True] * n
flag[0] = False

for i in range(k):
    num = a[num]
    if flag[num-1]:
        li.append(num)
        flag[num-1] = False
    else:
        break

d = li.index(num)
ans = (k-d)%(len(li)-d)+d

print(li[ans])

Buggy submission (verdict: Runtime Error):
import sys
n,k=map(int,input().split())
a=list(map(int,input().split()))
l=set()
l.add(1)
t=1
ans=[]
if k==1:
    print(a[0])
    sys.exit()
while k>0:
    tt=a[t-1]
    k-=1
    if k==0:
        print(a[tt-1])
        sys.exit()
    if tt not in l:
        l.add(tt)
        t=tt
    elif tt in l:
        ans.append(tt)
        break
tmp=0
while k>0:
    if a[tt-1] not in ans:
        ans.append(a[tt-1])
        k-=1
        if k==0:
            print(a[tt-1])
            sys.exit()
        tt=a[tt-1]
        tmp+=1
    if a[tt-1] in ans:
        print(ans[k%tmp])
        sys.exit()
Problem p02742 (python)

Fixed submission:
import sys
h,w=map(int,input().split())
if h==1 or w==1:
    print(1)
    sys.exit()
if h%2==0 and w%2==0:
    print(int(h*w/2))
elif h%2==1 and w%2==1:
    print(int(h*w/2)+1)
else:
    print(int(h*w/2))

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
if h==w==1:
    print(1)
    sys.exit()
if h%2==0 and w%2==0:
    print(int(h*w/2))
elif h%2==1 and w%2==1:
    print(int(h*w/2)+1)
else:
    print(int(h*w/2))
Problem p02743 (python)

Fixed submission:
from math import *
from decimal import *
a,b,c=map(int,input().split())
if 4*a*b<(c-a-b)**2 and c-a-b>0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
from math import *
from decimal import *
a,b,c=map(int,input().split())
if Decimal( a**2+ b**2+2*a+2*b+2*sqrt(a)*sqrt(b)))<Decimal(c**2):
    print("Yes")
else:
    print("No")
Problem p02761 (python)

Fixed submission:
import sys
n,m=map(int,input().split())
ans=[0 for i in range(n)]
f=[[True] for i in range(n)]
if n==1:
    for i in range(m):
        s,c=map(int,input().split())
        if f[s-1]==False:
            if ans[s-1]!=c:
                print(-1)
                sys.exit()
        if f[s-1]:
            f[s-1]=False
        ans[s-1]=c
    
    a=map(str,ans)
    print("".join(a))
    sys.exit()

for i in range(m):
    s,c=map(int,input().split())
    if s==1 and c==0:
        print(-1)
        sys.exit()
    if f[s-1]==False:
        if ans[s-1]!=c:
            print(-1)
            sys.exit()
    if f[s-1]:
        f[s-1]=False
    ans[s-1]=c
if ans[0]==0:
    ans[0]=1
a=map(str,ans)
print("".join(a))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ans=[0 for i in range(n)]
f=[[True] for i in range(n)]
for i in range(m):
    s,c=map(int,input().split())
    if f[s-1]==False:
        if ans[s-1]!=c:
            print(-1)
            sys.exit()
    if f[s-1]:
        f[s-1]=False
    ans[s-1]=c
if ans[0]==0:
    print(-1)
    sys.exit()
a=map(str,ans)
print("".join(a))
Problem p02780 (python)

Fixed submission:
from itertools import accumulate
from decimal import Decimal
n,k=map(int,input().split())
p=list(map(int,input().split()))
l=[0]
tmp=0
for i in range(n):
    p[i]=Decimal((p[i]+1)/2)
    tmp+=p[i]
    l.append(tmp)
ans=0
for i in range(k,n+1):
    tmp=l[i]-l[i-k]
    if tmp>ans:
        ans=tmp
print(Decimal(ans))

Buggy submission (verdict: Runtime Error):
from itertools import accumulate
from decimal import Decimal
n,k=map(int,input().split())
p=list(map(int,input().split()))
l=[]
tmp=0
for i in range(n):
    p[i]=Decimal((p[i]+1)/2)
    tmp+=p[i]
    l.append(tmp)
ans=l[k]
for i in range(k,n):
    tmp=l[i]-l[i-k]
    if tmp>ans:
        ans=tmp
print(Decimal(ans))
Problem p02817 (python)

Fixed submission:
s,t=input().split()
print(t,s,sep="")

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
print(max(0,a-k),max(0,b-max(0, k-a)))
Problem p02854 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=10**20
p=sum(a)
q=0
for i in range(n-1):
	q+=a[i]
	ans=min(ans,abs(p-q-q))
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
tmp=0
for i in range(n): 
    tmp+=a[i]
    if tmp*2==sum(a):
        print(0)
        sys.exit()
    if tmp*2>sum(a):
        l=i
        break
if abs(tmp*2-sum(a))>abs((tmp-a[l])*2-sum(a)):
    print(abs((tmp-a[l-1])*2-sum(a)))
else:
    print(abs(tmp*2-sum(a)))
Problem p02910 (python)

Fixed submission:
import sys
s=input()
a=["R","U","D"]
b=["L","U","D"]
for i in range(len(s)):
    if i%2==0:
        if s[i] not in a:
            print("No")
            sys.exit()
    else:
        if s[i] not in b:
            print("No")
            sys.exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
s=input()
print("No" if "L" in S[::2] or "R" in S[1::2] else "Yes")
Problem p02937 (python)

Fixed submission:
from math import *
from bisect import *
s=input()
t=input()
n=len(s)
nn=len(t)
ss=[[]for i in range(26)]
tt=[[] for i in range(26)]
ans=0
k=0
for i in range(n):
    ss[ord(s[i])-97].append(i+1)
for i in t:
    j=ss[ord(i)-97]
    if len(j)==0:
        print(-1)
        exit()
    else:
        if j[-1]<=ans:
            ans=j[0]
            k+=1
        else:
            ans=j[bisect(j,ans)]
print(k*n+ans)

Buggy submission (verdict: Runtime Error):
from math import *
from bisect import *
s=input()
t=input()
n=len(s)
nn=len(t)
ss=[[]for i in range(26)]
tt=[[] for i in range(26)]
ans=0
k=0
for i in range(n):
    ss[ord(s[i])-97].append(i+1)
for i in t:
    j=ss[ord(i)-97]
    if len(j)==0:
        print(-1)
        exit()
    else:
        if j[-1]<ans:
            ans=j[0]
            k+=1
        else:
            ans=j[bisect(j,ans)]
print(k*n+ans)
Problem p02953 (python)

Fixed submission:
n = int(input())
lis = list(map(int,input().split()))
lis[0]-=1
for i in range(n-1):
  if lis[i] < lis[i+1]:
    lis[i+1] -= 1
  elif lis[i] > lis[i+1]:
    print("No")
    exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
from collections import deque
n=int(input())
h=deque((map(int,input().split())))
flag=True
while h:
    if h[0]<=h[1]-1:
        h.popleft()
        if len(h)==1:
            break
    else:
        flag=False
        break
print("Yes" if flag else "No")
Problem p03032 (python)

Fixed submission:
n,k=map(int,input().split())
ans=0
v=list(map(int,input().split()))
for i in range(min(n,k+1)):
    for j in range(min(n-i+1,k-i+1)):
        if j!=0:
            tmp=v[:i]+v[-j:]
        else:
            tmp=v[:i]
        tmp.sort()
        t=sum(tmp)
        for d in range(min(k-i-j,len(tmp))):
            if tmp[d]<0:
                t-=tmp[d]
        if t>ans:
            ans=t
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans=0
v=list(map(int,input().split()))
for i in range(min(n,k+1)):
    for j in range(min(n-i,k-i+1)):
        if j!=0
            tmp=v[:i]+v[-j:]
        else:
            tmp=v[:i]
        tmp.sort()
        t=sum(tmp)
        for d in range(min(k-i-j,len(tmp))):
            if tmp[d]<0:
                t-=tmp[d]
        if t>ans:
            ans=t
print(ans)
Problem p03110 (python)

Fixed submission:
from decimal import Decimal
n=int(input())
ans=0
for i in range(n):
    x,y=map(str,input().split())
    if y=="BTC":
        ans+=Decimal(380000*Decimal(x))
    else:
        ans+=Decimal(x)
print(ans)

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
n=int(input())
ans=0
for in range(n):
    x,y=map(str,input().split())
    if y=="BTC":
        ans+=Decimal(380000*Decimal(x))
    else:
        ans+=Decimal(x)
print(ans)
Problem p03146 (python)

Fixed submission:
def f(s):
    cnt = 0
    st = set()

    cnt += 1
    st.add(s)

    while True:
        cnt += 1

        if s % 2 == 0:
            tmp = s / 2
        else:
            tmp = 3 * s + 1

        if tmp in st:
            break

        st.add(tmp)
        s = tmp
    return cnt


s = int(input())
ans = f(s)
print(ans)

Buggy submission (verdict: Runtime Error):
def f(a):
    cnt=0
    st=set()
    cnt+=1
    st.add(a)
    while True:
        if n%2!=0:
            tmp=a/2
        else:
            tmp=3*a+1
        if tmp in st:
            break
        st.add(tmp)
        a=tmp
    return cnt
a=int(input())     
ans= f(s)
print(ans)

Buggy submission (verdict: Runtime Error):
def f(a):
    cnt=0
    st=set()
    while True:
        if n%2!=0:
            tmp=a/2
        else:
            tmp=3*a+1
        if tmp in st:
            break
        st.add(tmp)
        a=tmp
    return cnt
a=int(input())     
ans= f(s)
print(ans)
Problem p03231 (python)

Fixed submission:
from math import gcd
N,M = map(int, input().split())
S = input()
T = input()
G = gcd(N,M)
for i in range (G):
  if S[N//G * i] != T[M//G * i]:
    print(-1)
    exit()
print(N//G * M//G * G)

Buggy submission (verdict: Runtime Error):
import fractions
import sys
input=sys.stdin.readline()
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
n,m=map(int,input().split())
s=input()
t=input()
if s[0]!=t[0]:
    print(-1)
    exit()
k=lcm(n,m)
ans=[""for i in range(k)]
ans[0]=s[0]
for i in range(1,n):
    ans[i*(k//n)]=s[i]
for i in range(1,m):
    if not ans[i*(k//m)]:
        ans[i*(k//m)]=t[i]
    else:
        if ans[i*(k//m)]!=t[i]:
            print(-1)
            exit()
print(k)
Problem p03238 (python)

Fixed submission:
n=int(input())
if n==1:
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)

Buggy submission (verdict: Runtime Error):
n,T=map(int,input().split())
data=[input().split() for i in range(n)]
lc=[]
for row in data:
    if int(row[1]) <=T:
        lc.append(int(row[0]))

if not lc:
    print("TLE")
else:
    a=sorted(lc)
    print(a[0])

Buggy submission (verdict: Runtime Error):
n,T=map(int,input().split())
data=[input().split() for i in range(n)]
lc=[]
for row in data:
    if int(row[1]) <=T:
        lc.append(row[0])
if  len(lc)==0:
    print("TLE")
else:
    print(min(lc))
Problem p03240 (python)

Fixed submission:
n=int(input())
z=[]
aa=[]
for i in range(n):
     z.append(list(map(int,input().split())))
for cx in range(101):
    for cy in range(101):
        ans=set()
        for i in range(n):
            x,y,h=z[i][0],z[i][1],z[i][2]
            if h!=0:
                tmp=h+abs(x-cx)+abs(y-cy)
                ans.add(tmp)
        if len(ans)==1:
            ans=list(ans)
            aa.append((ans[0],cx,cy))

for a,cx,cy in aa:
    flg=True
    for i in range(n):
        x,y,h=z[i][0],z[i][1],z[i][2]
        if h!=max(a-abs(x-cx)-abs(y-cy),0):
                flg=False
    if flg:
        print(cx,cy,a)
        exit()

Buggy submission (verdict: Runtime Error):
from copy import *
n,m=map(int,input().split())
t=int(m/n)
while True:
    if m%t==0:
        if t*n<=m:
            print(t)
            exit()
        else:
            t-=1
    else:
        t-=1

Buggy submission (verdict: Runtime Error):
n=int(input())
z=[]
for i in range(n):
     z.append(list(map(int,input().split())))
for cx in range(101):
    for cy in range(101):
        ans=set()
        for i in range(n):
            x,y,h=z[i][0],z[i][1],z[i][2]
            if h!=0:
                tmp=h+abs(x-cx)+abs(y-cy)
                ans.add(tmp)
        if len(ans)==1:
            for i in range(n):
                x,y,h=z[i][0],z[i][1],z[i][2]
                if h==0:
                    if ans[0]-abs(x-cx)-abs(y-cy)>=0:
                        break
            print(cx,cy,*ans)
            exit()
Problem p03263 (python)

Fixed submission:
h,w=map(int,input().split())
ans=[]
a=[list(map(int,input().split())) for i in range(h)]
flg=True
for i in range(h):
    if flg:
        for j in range(w):
            if a[i][j]%2==1:
                if j<w-1:
                    a[i][j+1]+=1
                    ans.append((i+1,j+1,i+1,j+2))
                if j==w-1:
                    if i<h-1:
                        a[i+1][j]+=1
                        ans.append((i+1,j+1,i+2,j+1))
        flg=False
    else:
        flg=True
        for j in range(w-1,-1,-1):
            if a[i][j]%2==1:
                if j>0:
                    a[i][j-1]+=1
                    ans.append((i+1,j+1,i+1,j))
                if j==0:
                    if i<h-1:
                        a[i+1][j]+=1
                        ans.append((i+1,j+1,i+2,j+1))
print(len(ans))
for i in ans:
    print(*i)

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
ans=[]
a=[list(map(int,input().split())) for i in range(h)]
flg=True
for i in range(h):
    if flg:
        for j in range(w):
            if a[i][j]%2==1:
                if j<w-1:
                    a[i][j+1]+=1
                    ans.append((i+1,j+1,i+1,j+2))
                if j==w-1:
                    if i<h-1:
                        a[i+1][j]+=1
                        ans.append(print(i+1,j+1,i+2,j+1))
        flg=False
    else:
        flg=True
        for j in range(w-1,-1,-1):
            if a[i][j]%2==1:
                if j>0:
                    a[i][j-1]+=1
                    ans.append((i+1,j+1,i+1,j))
                if j==0:
                    if i<h-1:
                        a[i+1][j]+=1
                        ans.append((i+1,j+1,i+2,j+1))
print(len(ans))
for i in ans:
    print(*i)
Problem p03294 (python)

Fixed submission:
n=int(input())
a=list(map(int, input().split()))
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
x=1
for t in a:
    x=lcm(x,t)
x-=1
ans=0
for t in a:
    ans+=x%t
print(ans)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
n=int(input())
a=list(map(int,input().split()))

b=lcm_list(a)-1
ans=0
for i in a:
    tmp=b%i
    ans+=tmp
print(ans)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
n=int(input())
a=list(map(int,input().split()))

b=lcm_list(a)-1
ans=0
for i in a:
    tmp=b%i
    ans+=tmp
print(ans)
Problem p03353 (python)

Fixed submission:
s = input()
l = len(s)
k = int(input())
A = set()
for i in range(l):
    for j in range(1, 6):
        if i+j <= l:
            A.add(s[i:i+j])
ANS = sorted(A)
print(ANS[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
t=int(input())
if t==1:
    print(s)
    exit()
ans=set()
for l in range(n-1):
    for r in range(1,min(t,n-l)):
        ans.add(s[l:r])
aa=list(ans)
aa.sort()
print(aa[t-1])

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
t=int(input())
if t==1:
    print(s)
    exit()
ans=set()
for l in range(n-1):
    for r in range(l+1,n+1):
        ans.add(s[l:min(l+t,r)])
aa=list(ans)
aa.sort()
print(aa[t-1])

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
t=int(input())
if t==1:
    print(s)
    exit()
ans=set()
for l in range(n-1):
    for r in range(l+1,n+1):
        ans.add(s[l:min(l+k,r)])
aa=list(ans)
aa.sort()
print(aa[t-1])

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
t=int(input())
if t==1:
    print(s)
    exit()
ans=set()
for l in range(n-1):
    for r in range(l+1,n+1):
        ans.add(s[l:r])
aa=list(ans)
aa.sort()
print(aa[t-1])
Problem p03361 (python)

Fixed submission:
import sys
h,w=map(int,input().split())
maze=[]
for i in range(h):
    maze.append(list(input()))
for i in range(h):
    for j in range(w):
        if maze[i][j]=="#":
            flg=False
            for l,m in [(0,1),(1,0),(-1,0),(0,-1)]:
                if 0<=i+l<h and 0<=j+m<w:
                    if maze[i+l][j+m]=="#":
                        flg=True
            if flg==False:
                print("No")
                sys.exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
h,w=map(int,input().split())
maze=[]
for i in range(w):
    maze.append(list(input()))
for i in range(w):
    for j in range(h):
        if maze[i][j]=="#":
            flg=False
            for l,m in [(0,1),(1,0),(-1,0),(0,-1)]:
                if 0<=i+l<w and 0<=j+m<h and maze[i+l][j+m]=="#":
                    flg=True
            if flg==False:
                print("No")
                sys.exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
h,w=map(int,input().split())
maze=[]
for i in range(w):
    maze.append(list(input()))
for i in range(w):
    for j in range(h):
        if maze[i][j]=="#":
            flg=False
            for l,m in [(0,1),(1,0),(-1,0),(0,-1)]:
                if 0<=i+l<w and 0<=j+m<h:
                    if maze[i+l][j+m]=="#":
                        flg=True
            if flg==False:
                print("No")
                sys.exit()
print("Yes")
Problem p03387 (python)

Fixed submission:
import sys
a=list(map(int,input().split()))
a.sort()
ans=0
while True:
    if a[0]==a[1]==a[2]:
        print(ans)
        sys.exit()
    if a[0]<a[1]:
        a[0]+=2
        ans+=1
        a.sort()
        if a[0]==a[1]==a[2]:
            print(ans)
            sys.exit()
    if a[0]==a[1]:
        a[0]+=1
        a[1]+=1
        ans+=1
        a.sort()
        if a[0]==a[1]==a[2]:
            print(ans)
            sys.exit()

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split()))
a.sort()
ans=0
while True:
    if a[0]==a[1]==a[2]:
        print(ans)
        sys.exit()
    if a[0]<a[1]:
        a[0]+=2
        ans+=1
        a.sort()
        if a[0]==a[1]==a[2]:
            print(ans)
            sys.exit()
    if a[0]==a[1]:
        a[0]+=1
        a[1]+=1
        ans+=1
        a.sort()
        if a[0]==a[1]==a[2]:
            print(ans)
            sys.exit()
Problem p03420 (python)

Fixed submission:
n,k=map(int,input().split())
b=[i for i in range(k+1,n+1)]
ans=0
if k==0:
    for i in range(len(b)):
        t=b[i]
        j=t-k
        ii=n//t
        ans+=ii*j
        ans+=max(n-ii*t-k,0)
    print(ans)
    exit()
for i in range(len(b)):
    t=b[i]
    j=t-k
    ii=n//t
    ans+=ii*j
    ans+=max(n-ii*t-k+1,0)
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
b=[i for i in range(k+1,n+1)]
ans=0
if k==0:
    for i in range(len(b)):
    t=b[i]
    j=t-k
    ii=n//t
    ans+=ii*j
    ans+=max(n-ii*t-k,0)
    print(ans)
    exit()
for i in range(len(b)):
    t=b[i]
    j=t-k
    ii=n//t
    ans+=ii*j
    ans+=max(n-ii*t-k+1,0)
print(ans)
Problem p03434 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=sorted(a,reverse=True)
alice=sum(b[::2])
Bob=sum(b[1::2])
print(alice-Bob)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=sorted(list(map(int,input().split()),reverse=True)
print(sum(a[::2])-sum(a[1::2]))
Problem p03456 (python)

Fixed submission:
ab=int(input().replace(" ",""))
flg=False
i=0
while i**2<=ab:
    if i**2==ab:
        flg=True
        break
    i+=1

print("Yes" if flg else "No")

Buggy submission (verdict: Runtime Error):
a,b=int(input().replace(" ",""))
flg=False
i=0
while i**2<=ab:
    if i**2==ab:
        flg=True
        break
    i+=1

print("Yes" if flg else "No")
Problem p03471 (python)

Fixed submission:
import sys
n,y=map(int,input().split())
if n*10000<y:
    print("-1 -1 -1")
    sys.exit()
if y//1000<n:
    print("-1 -1 -1")
    sys.exit()
m=y//10000
for i in range(m+1):
    g=(y-i*10000)//5000
    for j in range(g+1):
        s=(y-10000*i-5000*j)//1000
        if i+j+s==n and s>=0:
            print(i,j,s)
            sys.exit()
print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
import sys
n,y=map(int,input().split())
if n*10000<y:
    print("-1 -1 -1")
    sys.exit()
if y//1000<n:
    print("-1 -1 -1")
    sys.exit()
m=y//10000
g=(y-m*10000)//5000
k=(y-10000*i-5000*j)//1000
for i in range(m+1):
    for j in range(g+1):
        for s in range(k+1):
            s=(y-10000*i-5000*j)//1000
            if i+j+s==n and s>=0:
                print(i,j,s)
                sys.exit()
print("-1 -1 -1")