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

Fixed submission:
n,m=map(int,input().split())
print(m+max(0,100*(10-n)))

Buggy submission (verdict: Runtime Error):
#156D
p=7+10**9
def comb(n,r):
  bunshi = 1
  for i in range(n-r+1, n+1):
    bunshi =bunshi * i % p
  bunbo = 1
  for i in range(1, r+1):
    bunbo = bunbo * i % p
  return bunshi * pow(bunbo, p-2, p)
n,a,b=map(int,input().split())
s=-1+pow(2,n,p)-comb(n,a)-comb(n,b)
print(s%p)
Problem p02768 (python)

Fixed submission:
#156D
p=7+10**9
def comb(n,r):
  bunshi = 1
  for i in range(n-r+1, n+1):
    bunshi =bunshi * i % p
  bunbo = 1
  for i in range(1, r+1):
    bunbo = bunbo * i % p
  return bunshi * pow(bunbo, p-2, p)
n,a,b=map(int,input().split())
s=-1+pow(2,n,p)-comb(n,a)-comb(n,b)
print(s%p)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
Problem p02784 (python)

Fixed submission:
n,m=map(int,input().split())
l=list(map(int,input().split()))
s=sum(l)
if n<=s:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=list(map(int,input().split())
s=sum(l)
if n<=s:
  print("Yes")
else:
  print("No")
Problem p02789 (python)

Fixed submission:
n,m=map(int,input().split())
if n==m:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
n=int(input())
numbers=list(map(int,input().split()))
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
l=0
x=lcm_list(numbers)
for i in range(n):
    l+=(x//numbers[i])
print(l%(10**9+7))
Problem p02813 (python)

Fixed submission:
import itertools
n=int(input())
a=tuple(map(int,input().split()))
b=tuple(map(int,input().split()))
seq=range(1,n+1)
l=list(itertools.permutations(seq))
#print(l[0])

a_num=0
b_num=0
for i in range(len(l)):
  if l[i]==a:
    a_num=i
  if l[i]==b:
    b_num=i

print(abs(a_num-b_num))

Buggy submission (verdict: Runtime Error):
import itertools
n=int(input()
a=map(int,input().split())
b=map(int,input().split())
seq=range(n)
list(itertools.permutations(seq))
print(a)
print(list[0])
Problem p02843 (python)

Fixed submission:
n=input()
if len(n)==1:
  a=10
else:
  a=n[-2]+n[-1]
if a=="00":
  c=0
else:
  c=int(a)
b=int(n)//100
if b*5<c:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
n=input()
a=n[-2]+n[-1]
if a=="00":
  c=0
else:
  c=int(a)
b=int(n)//100
if b*5<c:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
n=input()
a=int(n[-2]+n[-1])
b=int(n)//100
if b*5<a:
    print(0)
else:
    print(1)
Problem p02921 (python)

Fixed submission:
S=input()
T=input()
a=0
for i in range(3):
    if S[i]==T[i]:
        a=a+1
    else:
        a=a+0
print(a)

Buggy submission (verdict: Runtime Error):
a=0
S=input()
T=input()
for i in 3:
	if S[i]==T[i]:
    	a=a+1
	else:
    	a=a
        
print(a)
Problem p02924 (python)

Fixed submission:
N=int(input())
mod=N*(N-1)//2
print(mod)

Buggy submission (verdict: Runtime Error):
mod=0
N=int(input())
a=list(range(1,N+1))
a.remove(1)
a.append(1)
#print(a)
b=list(range(1,N+1))
#print(b)
for i in range(N):
    mod=mod+(b[i]%a[i])
print(mod)
Problem p02936 (python)

Fixed submission:
n,q=map(int,input().split())
graph=[[] for i in range(n)]
visited=[False]*n
visited[0]=True
from collections import deque
for i in range(n-1):
    a,b=map(int,input().split())
    a-=1;b-=1
    graph[a].append(b)
    graph[b].append(a)

s=[0]*n
for i in range(q):
    p,x=map(int,input().split())
    s[p-1]+=x
quest=deque([0])#はじめどうせ見るし入れとく
while len(quest)!=0:
    see=quest.popleft()
    for i in graph[see]:
        if visited[i]==True:
            continue
        quest.append(i)
        visited[i]=True
        s[i]+=s[see]
#for i in range(n):
    #print(s[i],end=" ")
print(*s)

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
graph=[[] for i in range(n)]
visited=[False]*n
visited[0]=True
from collection import deque
for i in range(n-1):
    a,b=map(int,input().split())
    a-=1;b-=1
    graph[a].append(b)
    graph[b].append(a)

s=[0]*n
for i in range(q):
    p,x=map(int,input().split())
    s[p-1]+=x
quest=deque([0])#はじめどうせ見るし入れとく
while len(quest)!=0:
    see=quest.popleft()
    for i in graph[see]:
        if visited[i]==True:
            continue
        quest.append(i)
        visited[i]=True
        s[i]+=s[see]
#for i in range(n):
    #print(s[i],end=" ")
print(*s)
Problem p02945 (python)

Fixed submission:
import numpy as np
a,b=map(int,input().split())
s=np.max([a+b,a-b,a*b])
print(s)

Buggy submission (verdict: Runtime Error):
import numpy as np
a,b=map(int,input())
s=np.max([a+b,a-b,a*b])
print(s)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input.split())
s=max([a+b,a-b,a*b])
print(s)
Problem p02957 (python)

Fixed submission:
a,b=map(int,input().split())
c=(a+b)/2
if c%1==0:
    print(int(c))
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
a,b=map(int.input().split())
if (a+b)%2==1:
    print("IMPOSSIBLE")
else:
    print((a+b)//2)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
s=(a+b)/2
if s%1==0:
  print(s)
else:
  print(IMPOSSIBLE)
Problem p02994 (python)

Fixed submission:
n,l=map(int,input().split())
aji=[]
for i in range(n):
    aji.append(l+i)
aji_abs=[]
for i in aji:
    aji_abs.append(abs(i))
e=aji_abs.index(min(aji_abs))

print(sum(aji)-aji[e])

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
aji=[]
for i in range(n):
    aji.append(l+i)
e=aji.index(min(abs(aji)))
print(sum(aji)-aji[e])

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
s=[]
for i in range(n):
    s.append(l+i-1)
s.remove(min(abs(s)))
a=0
for i in s:
    a+=i
print(a)
Problem p02995 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
a_0=(a-1)//c
a_1=(a-1)//d
a_2=(a-1)//lcm(c,d)
n=a_0+a_1-a_2
#print(n)
b_0=b//c
b_1=b//d
b_2=b//lcm(c,d)
m=b_0+b_1-b_2
#print(m)
#b_1-b_2
print(b-a+1-(m-n))

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
a_0=a//c
a_1=a//d
a_2=a//lcm(c,d)
n=a_0+a_1-a_2
#print(n)
b_0=b//c
b_1=b//d
b_2=b//lcm(c,d)
m=b_0+b_1-b_2
#print(m)
#b_1-b_2
print(b-a+1-(m-n))
Problem p03059 (python)

Fixed submission:
a,b,t=map(int,input().split())
n=t//a
print(b*n)

Buggy submission (verdict: Runtime Error):
n=int(input())
c=list(map(int,input().split()))
v=list(map(int,input().split()))
s=0
for i in range(n):
    if c[i]-v[i]>0:
        s=s+c[i]-v[i]
print(s)
Problem p03071 (python)

Fixed submission:
a,b=map(int,input().split())
s=[2*a-1,a+b,2*b-1]
print(max(s))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
s=[2*a-1,a+b,2*b-1]
print(max(s)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
s=[2*a-1,a+b,2*b-1]
print(s.max())
Problem p03085 (python)

Fixed submission:
b=input()
if b=="A":
    print("T")
elif b=="T":
    print("A")
elif b=="C":
    print("G")
elif b=="G":
    print("C")

Buggy submission (verdict: Runtime Error):
if b=="A":
    print("T")
elif b=="T":
    print("A")
elif b=="C":
    print("G")
elif b=="G":
    print("C")
Problem p03103 (python)

Fixed submission:
n,m=map(int,input().split())
x=[list(map(int,input().split())) for i in range(n)]
x.sort(key=lambda x: x[0])
#print(x)
num=0
money=0
for i in range(n):
    num+=x[i][1]
    money+=x[i][1]*x[i][0]
    if num>m:
        money=money-(num-m)*x[i][0]
        break
print(money)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=[list(map(int,input().split())) for i in range(n)]
x.sort(key=lambda x: x[0])
#print(x)
num=0
money=0
i=0
if len(x)!=1:
    while num<=m:
        num+=x[i][1]
        money+=x[i][1]*x[i][0]
        i+=1
    #print(num)
    if num>m:
        i-=1
        money-=x[i][0]*(num-m)
    print(money)
else:
    print(x[0][0]*m)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a_b=[list(map(int,input().split()))for i in range(n)]
#print(a_b)
#print(index(4))
honsuu=0
money=0
index=0
a=[]
for i in range(n):
    a.append(a_b[i][0])
c=sorted(a)
if len(c)>=2:
	while honsuu<=m:
		money+=a_b[a.index(c[index])][0]*a_b[a.index(c[index])][1]
		honsuu+=a_b[a.index(c[index])][1]
		index+=1
	index-=1
	honsuu-=a_b[a.index(c[index])][1]
	money-=a_b[a.index(c[index])][0]*a_b[a.index(c[index])][1]
	M=m-honsuu
	money+=a_b[a.index(c[index])][0]*M
#print(a_b[a.index(c[0])][1])
#print(index)
	print(money)
else:
	print(a_b[0][0]*a_b[0][1])
Problem p03219 (python)

Fixed submission:
a,b=map(int,input().split())
print(a+b//2)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input(),split())
print(a+b//2)
Problem p03260 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[input() for i in range(n)]
s=0
for i in range(n-1):
    if a[i][-1]!=a[i+1][0]:
        s+=1
a.sort()
for i in range(n-1):
    if a[i]==a[i+1]:
        s+=1
if s==0:
    print("Yes")
else:
    print("No")
Problem p03261 (python)

Fixed submission:
n=int(input())
a=[input() for i in range(n)]
s=0
for i in range(n-1):
    if a[i][-1]!=a[i+1][0]:
        s+=1
a.sort()
for i in range(n-1):
    if a[i]==a[i+1]:
        s+=1
if s==0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[input() for i in range(n)]
s=0
for i in raneg(n-1):
    if a[i][-1]!=a[i+1][0]:
        s+=1
a.sort()
for i in raneg(n-1):
    if a[i]==a[i+1]:
        s+=1
if s==0:
    print("Yes")
else:
    print("No")
Problem p03281 (python)

Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

n=int(input())
#print(make_divisors(n))
s=0
for i in range(1,n+1,2):
    if len(make_divisors(i))==8:
        s+=1
print(s)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=0
for i in range(1,n):
    for j in range(1,i):
        a=0
        if i%j==0:
            a+=1
    if a==8:
        s+=1
print(s)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=0
for i in range(n):
    for j in range(i):
        a=0
        if i%j==0:
            a+=1
    if a==8:
        s+=1
print(s)
Problem p03289 (python)

Fixed submission:
n=input()
wa=0
#print(n[2:len(n)-1])
#print(n[len(n)])
if n[0]=="A" and n[2:len(n)-1].count("C")==1 and n[1]!="C" and n[len(n)-1]!="C":
    wa+=0
    import re
    a=re.sub('[AC ]', '',n)
else:
    wa+=1
    a=n
for i in range(len(a)):
    if 0<= ord(a[i]) - ord('a') <= 26:
        wa+=0
    else:
        wa+=1
if wa==0:
    print("AC")
else:
    print("WA")

Buggy submission (verdict: Runtime Error):
n=input()
wa=0
#print(n[2:len(n)-1])
if n[0]=="A" and n[2:len(n)-1].count("C")==1 and n[1]!="C" and n[len(n)]!="C":
    wa+=0
    import re
    a=re.sub('[AC ]', '',n)
else:
    wa+=1
    a=n
for i in range(len(a)):
    if 0<= ord(a[i]) - ord('a') <= 26:
        wa+=0
    else:
        wa+=1
if wa==0:
    print("AC")
else:
    print("WA")
Problem p03337 (python)

Fixed submission:
a,b=map(int,input().split())
s=[a+b,a-b,a*b]
print(max(s))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
s=[]
s.append(a+b,a-b,a*b)
print(max(s))
Problem p03351 (python)

Fixed submission:
#097a
a,b,c,d=map(int,input().split())
if -d<=a-c<=d:
    print("Yes")
elif -d<=a-b<=d and -d<=b-c<=d:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
def gauss_2(n):
    g=0
    while g<=n**(1/2):
        g+=1
    return g-1

def gauss_3(n):
    g=0
    while g<=n**(1/3):
        g+=1
    return g-1
def gauss_4(n):
    g=0
    while g<=n**(1/4):
        g+=1
    return g-1
def gauss_5(n):
    g=0
    while g<=n**(1/5):
        g+=1
    return g-1
def gauss_6(n):
    g=0
    while g<=n**(1/6):
        g+=1
    return g-1
def gauss_7(n):
    g=0
    while g<=n**(1/7):
        g+=1
    return g-1

if n<=3:
    print(1)
elif n not in (125,216,343,512,729):
    print(max(gauss_2(n)**2,gauss_3(n)**3,gauss_4(n)**4,gauss_5(n)**5,gauss_6(n)**6,gauss_7(n)**7))
else:
    print(n)
Problem p03377 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=int(input())
if a<=c<-a+b:
    print("YES")
else:
    print("NO")
Problem p03385 (python)

Fixed submission:
n=list(input())
n.sort()
a=n[0]+n[1]+n[2]
if a=="abc":
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=input()
n.sort()
if n="abc":
    print("Yes")
else:
    print("No")
Problem p03451 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
Candies=[]
for i in range(n):
    Candies.append(sum(a[:i+1])+sum(b[i:]))
print(max(Candies))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
Candies=[]
for i in range(n):
    Candies.appned(sum(a[:i+1])+sum(b[i+1:])
print(max(Candies))
Problem p03474 (python)

Fixed submission:
a,b=map(int,input().split())
s=input()
y=0
#c=[0,1,2,3,4,5,6,7,8,9]
for i in range(a):
    if s[i] not in ["0","1","2","3","4","5","6","7","8","9"]:
        y+=1
if s[a]!="-":
    y+=1
for i in range(a+1,a+b+1):
    if s[i] not in ["0","1","2","3","4","5","6","7","8","9"]:
        y+=1
#print(y)
if y==0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
s=input()
y=0
c=[0,1,2,3,4,5,6,7,8,9]
for i in range(a):
    for j in range(len(c)):
        if int(s[i])!=c[j]:
            y+=1
if s[a]!="-":
    y+=1
for i in range(a+1,a+b+1):
    for j in range(len(c)):
        if int(s[i])!=c[j]:
            y+=1
if y!=0:
    print("Yes")
else:
    print("No")
Problem p03485 (python)

Fixed submission:
a,b=map(int,input().split())
import math
c=(a+b)/2
print(math.ceil(c))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
import numpy as np
import math
c=np.mean(a,b)
print(math.ceil(c))
Problem p03605 (python)

Fixed submission:
n=input()
a=0
for i in range(len(n)):
    if n[i]=="9":
        a+=1
if a!=0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=input()
a=0
for i in range(len(n)):
	if n[i]=="9":
    	a+=1
if a!=0:
	print("Yes")
else:
	print("No")
Problem p03624 (python)

Fixed submission:
s=set(input())
a=[]
for i in s:
  a.append(ord(i)-ord("a"))
for i in range(26):
  if i not in a:
    print(chr(i+ord("a")))
    break
if len(a)==26:
  print("None")

Buggy submission (verdict: Runtime Error):
s=set(input())
a=[]
for i in s:
  a.append(ord(i)-ord("a"))
for i in range(26):
  if i not in a:
    print(chr(i+ord("a"))
    break
Problem p03633 (python)

Fixed submission:
import fractions
from functools import reduce
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n=int(input())
t=[int(input()) for i in range(n)]
print(lcm_list(t))

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())
t=[int(input()) for i in range(n)]
print(lcm_list(t))
Problem p03679 (python)

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

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

Fixed submission:
input_line = input().split(" ")
min_fig = int(input_line[0])
max_fig = int(input_line[1])
sample = int(input_line[2])
if min_fig % sample == 0:
    minus_num = int(min_fig / sample) -1
else:
    minus_num = int(min_fig / sample)
plus_num = int(max_fig / sample)
print(plus_num-minus_num)

Buggy submission (verdict: Runtime Error):
import math
num_limit = int(input())
s_limit_1 = int(num_limit**0.5)
s_limit_2 = int((num_limit/2)**0.5)
s_limit_3 = int((num_limit/3)**0.5)
for i in range(1,num_limit+1):
    xyz_list = []
    xyz_count = 0
    s_limit_1 = int(i ** 0.5)
    j = 0
    k = 0
    l = 0
    for j in range(1,s_limit_1+1):
        for k in range(1,j+1):
            if i <= j**2 + k**2 + l**2 + j*k + k*l + l*j:
                break
            for l in range(1,k+1):
                if i == j**2 + k**2 + l**2 + j*k + k*l + l*j:
                    if j == k and k == l:
                        xyz_count += 1
                    elif j == k and k > l or j > k and k == l:
                        xyz_count += 3
                    else:
                        xyz_count += 6
                if i < j**2 + k**2 + l**2 + j*k + k*l + l*j:
                    break
    print(xyz_count)
Problem p02608 (python)

Fixed submission:
num_limit = int(input())
num_list = [0] * num_limit
j_limit = int(num_limit ** 0.5)
for j in range(1,j_limit+1):
    for k in range(1,j + 1):
        for l in range(1,k+1):
            if num_limit >= j**2 + k**2 + l**2 + j*k + k*l + l*j:
                if j > k:
                    if k > l:
                        num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 6
                    else:
                        num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 3
                elif k > l:
                    num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 3
                else:
                    num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 1
for i in num_list:
    print(i)

Buggy submission (verdict: Runtime Error):
num_limit = int(input())
for i in range(1,num_limit+1):
    xyz_count = 0
    j_limit = int(i ** 0.5)
    for j in range(1,j_limit+1):
        for k in range(1,j + 1):
            if i <= j**2 + j*2 +3:
                break:
            if i <= j**2 + k**2 + j*k + j + k:
                break
            for l in range(1,k+1):
                if i < j**2 + k**2 + l**2 + j*k + k*l + l*j:
                    break
                elif i == j**2 + k**2 + l**2 + j*k + k*l + l*j:
                    if j > k:
                        if k > l:
                            xyz_count += 6
                        else:
                            xyz_count += 3
                    elif k > l:
                        xyz_count += 3
                    else:
                        xyz_count += 1
    print(xyz_count)
Problem p02582 (python)

Fixed submission:
N=input()
X=0
Y=0
for i in range(len(N)):
  if N[i]=="R":
    X+=1
  else:
    Y=max([X,Y])
    X=0
print(max([X,Y]))

Buggy submission (verdict: Runtime Error):
N=input()
X=0
Y=0
for i in range(len(N)):
  if N[i]="R":
    X+=1
  else:
    Y=X
    X=0
print(max([X,Y]))

Buggy submission (verdict: Runtime Error):
N=input()
X=0
Y=0
for i+1 in range(len(N)):
  if N[i]="R":
    X+=1
  else:
    Y=X
    X=0
print(max([X,Y]))

Buggy submission (verdict: Runtime Error):
N=input()
X=0
Y=0
for i+1 in range(len(N)):
  if N[i]="R":
    X+=1
  else:
    Y=X
    X=0
print(max(X,Y))
Problem p02630 (python)

Fixed submission:
N=int(input())
A=[int(i) for i in input().split()]
Q=int(input())
X=[i+1 for i in range((10**5))]
dic={}
ans=sum(A)
for i in A:
	try:
		dic[i]+=1
	except:
		dic.setdefault(i,1)
for i in range(Q):
	[B,C]=[int(i) for i in input().split()]
	try:
		ans+=dic[B]*(C-B)
		try:
			dic[C]+=dic[B]
		except:
			dic.setdefault(C,dic[B])
		dic[B]=0
	except:
		ans+=0
	print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(i) for i in input().split()]
Q=int(input())
X=[i+1 for i in range((10**5))]
dic={}
ans=sum(A)
for i in A:
	try:
		dic[i]+=1
	except:
		dic.setdefault(i,1)
for i in range(Q):
	[B,C]=[int(i) for i in input().split()]
	ans+=dic[B]*(C-B)
	try:
		dic[C]+=1
	except:
		dic.setdefault(C,1)
	print(ans)
Problem p02646 (python)

Fixed submission:
[A,V]=[int(i) for i in input().split()]
[B,W]=[int(i) for i in input().split()]
T=int(input())
if W-V>0 or abs(B-A)>T*abs(W-V):print("NO")
else:print("YES")

Buggy submission (verdict: Runtime Error):
[A,V]=[int(i) for i in input().split()]
[B,W]=[int(i) for i in input().split()]
T=int(input())
if abs(A-B)=>T*abs(V-W):print("NO")
else:print("YES")

Buggy submission (verdict: Runtime Error):
[A,V]=[int(i) for i in input.split()]
[B,W]=[int(i) for i in input.split()]
T=int(input())
if max(A-B,B-A)>T*max(V-W,W-V):print("NO")
else:print("YES")
Problem p02705 (python)

Fixed submission:
print(3.1415*int(input())*2)

Buggy submission (verdict: Runtime Error):
print(3.1415*R*2)

Buggy submission (verdict: Runtime Error):
R=input()
print(R*3.14)

Buggy submission (verdict: Runtime Error):
R=input()
print(R*3.1415)

Buggy submission (verdict: Runtime Error):
R=input()
print(R*3.141)
Problem p02971 (python)

Fixed submission:
import copy
N = int(input())
S = []
for i in range(N):
    S.append(int(input()))

B=copy.copy(S)
B.sort()
if N>2:
	C=int(B[N-1])
	D=int(B[N-2])
	for i in S:
		if int(i)>=C:
			print(D)
		else:
			print(C)

else:
	print(S[1])
	print(S[0])

Buggy submission (verdict: Runtime Error):

N = int(input())
S = []
for i in range(N):
    S.append(int(input()))

B=copy.copy(S)
B.sort()
if N>2:
	C=int(B[N-1])
	D=int(B[N-2])
	for i in S:
		if int(i)>=C:
			print(D)
		else:
			print(C)

else:
	print(S[1])
	print(S[0])

Buggy submission (verdict: Runtime Error):
N = int(input())
S = []
for _ in range(N):
    S.append(input())  # S += [input()] とも書ける

B=S.copy()
B.sort()
if N!=2:
	C=int(B[N-1])
	D=int(B[N-2])
	for i in S:
		if int(i)>=C:
			print(D)
		else:
			print(C)

else:
	print(S[1])
	print(S[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[]
for p in range(N):
	A+=[int(input())]
B=A.copy()
B.sort()
if N!=2:
	C=int(B[N-1])
	D=int(B[N-2])
	for i in A:
		if i==C:
			print(D)
		else:
			print(C)

else:
	print(A[1])
	print(A[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[]
for n in range(N):
	A+=[int(input())]
B=A.copy()
B.sort()
if N!=2:
	C=int(B[N-1])
	D=int(B[N-2])
	for i in A:
		if i==C:
			print(D)
		else:
			print(C)

else:
	print(A[1])
	print(A[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[]
for n in range(N):
	A+=[int(input())]
B=A.copy()
B.sort()
if N==2:
	C=int(B[-1])
	D=int(B[-2])
	for i in A:
		if i==D:
			print(C)
		else:
			print(D)

else:
	print(A[1])
	print(A[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[]
for n in range(N):
	A.append(int(input()))
B=A.copy()
B.sort()
C=int(B[-1])
D=int(B[-2])
for i in range(N):
	if A[i]>D:
		print(D)
	else:
		print(C)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[]
for n in range(N):
	A.append(int(input()))
B=A.copy()
B.sort()
C=B[N-1]
D=B[N-2]
for i in range(N):
	if A[i]>D:
		print(D)
	else:
		print(C)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[]
for n in range(N):
	A.append(input())
B=A.copy()
B.sort()
C=B[N-1]
D=B[N-2]
for i in range(N):
	if A[i]>D:
		print(D)
	else:
		print(C)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[]
for n in range(N):
	A.append(input())
B=A.copy()
B.sort()
C=B[N-1]
D=B[N-2]
for i in range(N):
	if A[i]==C:
		print(D)
	else:
		print(C)
Problem p02981 (python)

Fixed submission:
A=[int(i) for i in input().split()]
n=A[0]
a=A[1]
b=A[2]
c=n*a

if c>b:
	print(b)
else:
	print(c)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(i) for i in input().split()]
B=[None for i in range(N)]
res=0
for n in range(N):
	if n%2!=0:res-=A[n]
	else:res+=A[n]
B[0]=res
ans=str(res)+" "
for i in range(1,N):
	B[i]=int((A[i-1]-(int(B[i-1])/2))*2)
	ans=str(ans)+str(B[i])+" "

print(ans)