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

Fixed submission:
from fractions import gcd


def list_lcm(A):
    """N個の最小公倍数
    Args:
        A (list[int])

    Returns:
        int: 最小公倍数

    Examples:
        >>> list_lcm([12, 34, 54, 65])
        119340
    """
    ans = A[0]
    for i in range(1, len(A)):
        ans = ans * A[i] // gcd(ans, A[i])
    return ans


def resolve():
    A, B, C, D = map(int, input().split())
    A -= 1

    lcm_C_D = list_lcm([C, D])
    ans_B = B - B // C - B // D + B // lcm_C_D
    ans_A = A - A // C - A // D + A // lcm_C_D

    print(ans_B - ans_A)


resolve()

Buggy submission (verdict: Runtime Error):
def list_lcm(A):
    """N個の最小公倍数
    Args:
        A (list[int])

    Returns:
        int: 最小公倍数

    Examples:
        >>> list_lcm([12, 34, 54, 65])
        119340
    """
    ans = A[0]
    for i in range(1, len(A)):
        ans = ans * A[i] // gcd(ans, A[i])
    return ans


def resolve():
    A, B, C, D = map(int, input().split())
    A -= 1

    lcm_C_D = list_lcm([C, D])
    ans_B = B - B // C - B // D + B // lcm_C_D
    ans_A = A - A // C - A // D + A // lcm_C_D

    print(ans_B - ans_A)


resolve()
Problem p02690 (python)

Fixed submission:
x=int(input())
for i in range(-133,133):
    for j in range(-133,133):
        if  i**5 == j**5 + x :
            print(i,j)
            exit()

Buggy submission (verdict: Runtime Error):
x=int(input)
for i in range(-1000,1000):
  for j in range(-1000,1000):
    if i**5 ==x+j**5:
      print(i,j)
      exit()
Problem p02645 (python)

Fixed submission:
s = input()

print(s[:3])

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

print(s[:3])

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

print(s[:2])
Problem p02789 (python)

Fixed submission:
n, m = list(map(int, input().split()))

result = "Yes" if n == m else "No"
print(result)

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

j = p[0]
count = 0
for i in range(n):
    if p[i] <= j:
        count += 1
        j = p[i]
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = input().split()

j = p[0]
count = 1
for i in range(n):
    if p[i] <= j:
        count += 1
        j = p[i]
print(count)
Problem p02791 (python)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))

j = p[0]
count = 0
for i in range(n):
    if j >= p[i]:
        count += 1
        j = p[i]
print(count)

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

j = p[0]
count = 1
for i in range(n):
  '''
    if j == 1:
        break
        '''
    if p[i] <= j:
        count += 1
        j = p[i]
print(count)
Problem p02612 (python)

Fixed submission:
N = input()
if int(N) < 1001:
    x = N
elif int(N[-3]+N[-2]+N[-1]) == 0:
    x = 1000
else:
    x = N[-3]+N[-2]+N[-1]
print (1000 - int(x))

Buggy submission (verdict: Runtime Error):
N = input()
x = N[-3]+N[-2]+N[-1]
print (1000 - int(x))
Problem p02684 (python)

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

n=[-1]*(N+2)
n[1]=0
i=0 #カウンター
place_now=1 #いる場所

while True:
  
  i+=1 #何回飛んだか
  place_now=A[place_now-1] #飛んだ時の場所
  
  
  if n[place_now] != -1:
    a=n[place_now] #ループの開始点
    loop=i-a #ループする長さ
    break
  
  n[place_now]=i #その場所につくのに何回飛んだか
  
if a>=K:
  print(n.index(K))
elif a<K:
  k_remain=(K-a)%loop+a
  print(n.index(k_remain))

Buggy submission (verdict: Runtime Error):
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))
 
if K<=N:
  nex=0
  for i in range(K):
    
    ans=A[nex]
    nex=ans
  print(ans)
  sys.exit()
    
n=[0]*(N+1) #行った場所
 
n[0]=A[0] #1回目にどこにいるか
nex=A[0]
 
for i in range(1,N): #2回目以降にどこにいるか 
  n[i]=A[nex-1] #いる場所
  nex=A[nex-1]
  
  if n[nex-1]!=0:
    d=n[nex-1]
    break
 
roop_start=n.index(d)
length=i+1-roop_start
 
k_remain=(K-len(n[:roop_start])+length)%length
 
print(n[roop_start:length+1][k_remain-1])

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

if K<=N:
  nex=0
  for i in range(K):
    
    ans=A[nex]
    nex=ans
  print(ans)
  sys.exit()
    
n=[0]*N #行った場所

n[0]=A[0] #1回目にどこにいるか
nex=A[0]

for i in range(1,N): #2回目以降にどこにいるか 
  n[i]=A[nex-1] #いる場所
  nex=A[nex-1]
  
  if n[nex-1]!=0:
    d=n[nex-1]
    break

roop_start=n.index(d)
length=i+1-roop_start

k_remain=(K-len(n[:roop_start])+length)%length

print(n[roop_start:length+1][k_remain-1])

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

if K<=N:
  nex=0
  for i in range(K):
    
    ans=A[nex]
    nex=ans
  print(ans)
  sys.exit()
    
n=[0]*N
n[0]=A[0]

for i in range(N):
  if A[n[i]-1] in n:
    a=n.index(A[n[i]-1])
    le=len(n[a:i+1]) #ループ
    break
  n[i+1]=A[n[i]-1]

k_remain=(K-len(n[:i+1])+le)%le

print(n[a:i+1][k_remain-1])
Problem p02687 (python)

Fixed submission:
S=input()

if S=="ABC":
  print("ARC")
  
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
N,M=list(map(int, input().split()))
H=list(map(int, input().split()))
A=[list(map(int, input().split())) for _ in range(M)]

dp=[True]*N
a=[0]*N

for i in A:
  if H[i[0]-1]<H[i[1]-1] and a[i[1]-1]==0:
    dp[i[1]-1]=True
    dp[i[0]-1]=False
    a[i[0]-1]+=1
  elif H[i[0]-1]<H[i[1]-1] and a[i[1]-1]!=0:
    a[i[0]-1]+=1
    continue
  elif H[i[0]-1]>H[i[1]-1] and a[i[0]-1]==0:
    dp[i[1]-1]=False
    dp[i[0]-1]=True
    a[i[1]-1]+=1
  elif H[i[0]-1]>H[i[1]-1] and a[i[0]-1]!=0:
    a[i[1]-1]+=1
    continue
  elif H[i[0]-1]==H[i[1]-1]:
    dp[i[1]-1]=False
    dp[i[0]-1]=False
  

print(dp.count(True))
Problem p02694 (python)

Fixed submission:
X=int(input())
i=0
a=100
while a<X:
  n=int(a*1.01)
  a=n
  i+=1
print(i)

Buggy submission (verdict: Runtime Error):
import sys
K=int(input())
 
A,B=list(map(int, input().split()))
 
for i in range(A,B+1):
  if i%K==0:
    
    print("Yes")
    sys.exit()

print("No")
Problem p02714 (python)

Fixed submission:
N=int(input())

S=list(input())
m=0

a=S.count("R")
b=S.count("G")
c=S.count("B")

num=a*b*c

for i in range(N-2):
  for j in range(i+1,N):
    k=2*j-i #削る条件
    if k>N-1:
      break
    elif S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
      m+=1
      
print(num-m)

Buggy submission (verdict: Runtime Error):
ースコード 

Copy
Copy
N=int(input())
 
S=list(input())
m=0
 
a=S.count("R")
b=S.count("G")
c=S.count("B")
 
num=a*b*c
 
for i in range(N-2):
  for j in range(i+1,N-1):
    k=2*j-i #削る条件
    if k>N-1:
      break
    elif S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
      m+=1
      
print(num-m)

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

S=list(input())
m=0

a=S.count("R")
b=S.count("G")
c=S.count("B")

num=a*b*c

for i in range(N-2):
  for j in range(i+1,N):
    k=2*j-i
    if k>=n-1:
      break
    elif S[i]!=S[j]!=S[k]:
      m+=1
      
print(num-m)
Problem p02747 (python)

Fixed submission:
S = input()
hitachi = [
    'hi',
    'hihi',
    'hihihi',
    'hihihihi',
    'hihihihihi',
]
if S in hitachi:
    print('Yes')
else:
    print('No')

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

id=[i for i,k in enumerate(h) if k=="h"] 

a=0

for l in id:
  if "i"==h[l+1]:
    if "i"!=h[l+2]:
      a+=1
    elif "ii" == h[l+2]:
      a+=0
  elif "i" != h[l+1]:
    a+=0
        
if "h" not in h:
  a+=0
  
if a>0:
  print("Yes")
else:
  print("No")
Problem p02760 (python)

Fixed submission:
import numpy as np
N_1=list(map(int, input().split()))
N_2=list(map(int, input().split()))
N_3=list(map(int, input().split()))
N=int(input())
a=[int(input()) for i in range(N)]

n=np.array([N_1,N_2,N_3])

for a_n in a:
    if a_n in n:
        n[n==a_n]=0
    else:
        pass
i=0
    
if np.all(n[0:,0]==0)==True:
    i=+1
    
elif np.all(n[0:,1]==0)==True:
    i+=1
    
elif np.all(n[0:,2]==0)==True:
    i+=1
    
elif np.all(n[0,0:]==0)==True:
    i+=1
    
elif np.all(n[1,0:]==0)==True:
    i+=1

elif np.all(n[2,0:]==0)==True:
    i+=1

elif n[0,0]==0 and n[1,1]==0  and n[2,2] ==0:
    i+=1
    
elif n[0,2]==0 and n[1,1]==0 and n[2,0] ==0:
    i+=1
    
if i>0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a_1=list(map(int, input().split()))
a_2=list(map(int, input().split()))
a_3=list(map(int, input().split()))

c=[a_1,a_2,a_3]

N=int(input())

b=[int(input()) for _ in range(N)]

for i in range(3):
    for j in range(3):
        if a[i][j] in b:
            a[i][j]=0
            
            
i=0
if a[0][0]==0 and a[0][1]==0 and a[0][2]:
    i+=1
if a[1][0]==0 and a[1][1]==0 and a[1][2]:
    i+=1
if a[2][0]==0 and a[2][1]==0 and a[2][2]:
    i+=1
if a[0][0]==0 and a[1][0]==0 and a[2][0]:
    i+=1
if a[0][1]==0 and a[1][1]==0 and a[2][1]:
    i+=1
if a[0][2]==0 and a[1][2]==0 and a[2][2]:
    i+=1
if a[0][0]==0 and a[1][1]==0 and a[2][2]:
    i+=1
if a[0][2]==0 and a[1][1]==0 and a[2][0]:
    i+=1
    
if i>0:
    print("Yes")
elif i==0:
    print("No")

Buggy submission (verdict: Runtime Error):
import numpy as np
N_1=list(map(int, input().split()))
N_2=list(map(int, input().split()))
N_3=list(map(int, input().split()))
N=int(input())
a=[int(input()) for i in range(N)]

n=np.array([N_1,N_2,N_3])

for a_n in a:
    if a_n in n:
        n[n==a_n]=0
    else:
        pass

if np.all(n[0:,0])==0:
    i=+1
elif np.all(n[0:,1])==0:
    i+=1
elif np.all(n[0:,2])==0:
    i+=1
elif np.all(n[0,0:])==0:
    i+=1
elif np.all(n[1,0:])==0:
    i+=1                
elif np.all(n[2,0:])==0:
    i+=1                
elif n[0,0] and n[1,1] and n[2,2] ==0:
    i+=1                
elif n[0,2] and n[1,1] and n[2,0] ==0:
    i+=1

if i>0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b,c=int(input()).split()
d,e,f=int(input()).split()
g,h,i=int(input()).split()

x=[[a,b,c],[d,e,f],[g,h,i]]
while True:
    b_i=int(input())
    if b_i in x:
        x[b_i]=0
if x[:,0]==0:
    print(“Yes”)
if x[:,1]==0:
    print(“Yes”)
if x[:,2]==0:
    print(“Yes”)
if x[0,:]==0:
    print(“Yes”)
if x[1,:]==0:
    print(“Yes”)
if x[2:,]==0:
    print(“Yes”)
if x[0,0] and x[1,1] and x[2,2]==0:
    print(“Yes”)
if x[0,2] and x[1,1] and x[2,0]==0:
    print(“Yes”)
else:
    print(“No”)
Problem p03471 (python)

Fixed submission:
import sys

N,Y=list(map(int, input().split()))

for j in range(N+1):
    for k in range(N+1):
        if N-j-k<0:
            continue
        Total=10**4*(N-j-k)+5000*j+10**3*k
        if Total==Y:
            print("{} {} {}".format(N-j-k,j,k))
            sys.exit()
        
print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
import sys

N,Y=list(map(int, input().split()))

for j in range(N+1):
    for k in range(N+1):
        if N-j-k<0:
            continue
        Total=10**4*(N-j-k)+5000*j+10**3*k
        if Total==Y:
        print("{} {} {}".format(N-j-k,j,k))
        sys.exit()
        
print("-1 -1 -1")
Problem p02621 (python)

Fixed submission:
a = int(input())
print(a + a ** 2 + a ** 3)

Buggy submission (verdict: Runtime Error):
print(a + (a ** 2) + (a ** 3))
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = int(input().split())
print(a*b)
Problem p02658 (python)

Fixed submission:
_, *a = map(int, open(0).read().split())
ret = 1
for x in sorted(a):
  ret *= x
  if ret > 10 ** 18:
    ret = -1; break
    
print(ret)

Buggy submission (verdict: Runtime Error):
_, *a = map(int, open(0).read.split())
ret = 1
for x in sorted(a):
  ret *= x
  if ret > 10**18:
    ret = -1
    break
print(ret)

Buggy submission (verdict: Runtime Error):
_, *a = map(int, open(0).read.split())
ret = 1
for x in a:
  ret *= x
  if ret > 10**18:
    ret = -1
    break
print(ret)

Buggy submission (verdict: Runtime Error):
_, *a = map(int, input().split())
ret = 1
for x in a:
  ret *= x
  if ret > 10**18:
    print(-1)
    return

print(ret)
Problem p03251 (python)

Fixed submission:
def main():
    n, m, x, y = list(map(int, input().split()))
    x_list = list(map(int, input().split()))
    y_list = list(map(int, input().split()))
    x_list.append(x)
    y_list.append(y)

    zx = max(x_list) + 1
    zy = min(y_list)

    if zx > zy :
        print('War')
    else:
        print('No War')


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n, m, x, y = list(map(int, input().split()))
    x_list = list(map(int, input().split()))
    y_list = list(map(int, input().split()))
    x_list.append(x)
    y_list.append(y)

    zx = max(x_list) + 1
    zy = min(y_list)

    if zx > zy :
        print('War')
	else:
    	print('No war')


if __name__ == '__main__':
    main()
Problem p02615 (python)

Fixed submission:
import math

N = int(input())
A = list(map(int, input().split()))
Asrt = sorted(A, reverse=True)


num = math.ceil(N/2)

a = Asrt[:num]

if N % 2 == 0:#guusuu
    print(sum(a) * 2 - a[0])
else:#kisuu
    print(sum(a) * 2 - a[0] - a[-1])

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
A = list(map(int, input().split()))
Asrt = sorted(A, reverse=True)


num = math.ceil(N/2)

a = Asrt([:num])

if N % 2 == 0:#guusuu
    print(sum(a) * 2 - a[0])
else:#kisuu
    print(sum(a) * 2 - a[0] - a[-1])
Problem p02642 (python)

Fixed submission:
N=int(input())
A=[int(i) for i in input().split()]
D=set()
S=set()
for i in range(N):
    if A[i] in S:
        D.add(A[i]) # ダブったやつ
    else:
        S.add(A[i])# かぶり除去
M=max(S) #最大値
X=[1 for i in range(M+1)] #M個の1のリスト
for a in S:
    if a in D:# かぶってたらフラグ除去
        X[a]=0
    for i in range(2*a,M+1,a): # aのN倍をフラグ除去
        X[i]=0
ans=0
for i in range(N):
    if X[A[i]]==1:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
A.sort() # 一応

count = 0
while 1:
    new = []
    b = A[0]
    for a in A[1:]:
        if a % b > 0: # bで割れなければ続投
            new.append(a)
    A = new
    # かぶりがないなら
    if b < A[1]:
        count += 1


print(count)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
A = A.sort() # 一応

count = 0
while A ~= []:
    new = []
    b = A[0]
    for a in A[1:]:
        if a % b > 0: # bで割れなければ続投
            new.append(a)
    A = new
    count += 1


print(count)
Problem p02885 (python)

Fixed submission:
a, b = list(map(int, input().split()));
ans = 0;
if a > (b*2):
    ans = a - (b * 2);
print(ans);

Buggy submission (verdict: Runtime Error):
a, b = list(map(int, inout().split()));
ans = 0;
if a <= (b*2):
  ans = 0;
else:
  ans = a - (b*2);
  
print(ans);
Problem p03351 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
ans = "No"

if abs(a-c) <= d:
    ans = "Yes"
elif abs(a-b) <= d and abs(b-c) <= d:
    ans = "Yes"

print(ans)

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if (a - c) <= c:
    print("Yes"):
else:
    print("No")
Problem p02621 (python)

Fixed submission:
a = int(input())
print(a+a**2+a**3)

Buggy submission (verdict: Runtime Error):
a = input()
print(a+a**2+a**3)
Problem p03423 (python)

Fixed submission:
n = int(input())
print(n // 3)

Buggy submission (verdict: Runtime Error):
n = map(int, input())
print(n // 3)
Problem p03425 (python)

Fixed submission:
import itertools
n = int(input())
counters = {"M":0,"A":0,"R":0,"C":0,"H":0}

for _ in range(n):
  s = input()[0]
  
  if s in "MARCH":
  	counters[s] += 1
res = 0
for i in list(itertools.combinations(["M","A","R","C","H"],3)):
  res += counters[i[0]] * counters[i[1]] * counters[i[2]]

print(res)

Buggy submission (verdict: Runtime Error):
import itertools
n = int(input())
names = [input() for i in range(n)]
names = [i for i in names if i[0] in "MARCH"]


print(len(list(itertools.combinations(seq,3))))
Problem p02612 (python)

Fixed submission:
n = [i for i in range(1000,10001,1000)]
m = int(input())
for i in n:
    if i > m or i == m:
        a = i - m
        break
print(a)

Buggy submission (verdict: Runtime Error):
n = [i for i in range(1000,10001,1000)]
m = int(input())
for i in n:
    if i > m:
        a = i - m
        break
    # break
print(a)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
import numpy
n = int(input())
# for i in range(n):
#     m = int(input())
#     k = k*m
# op = 1
p = list(map(int,input().split()))
# for i in p:
#     op = op*i
op = numpy.prod(p)
if op > 10**18:
    print(-1)
else:
    print(op)

Buggy submission (verdict: Runtime Error):
a,b = map(int,inout().split())
print(a*b)
Problem p02706 (python)

Fixed submission:
days , assi = map(int,input().split())
lst = []
lst = [int(i) for i in input().split()]
tot = sum(lst)
if (tot>days):
    print(-1)
else:
    print(days-tot)

Buggy submission (verdict: Runtime Error):
days, assi = map(int, input().split())
lst = []
for i in range(assi):
    i = int(input())
    lst.append(i)
    tot = sum(lst)
if (days > tot):
    print(days-tot)
elif (days == tot):
    print(days-tot)
else:
    print('-1')

Buggy submission (verdict: Runtime Error):
days, assi = map(int, input().split())
lst = []
while(assi > 1):
    a = list(map(int, input().split()))
    assi -= 1
    tot = sum(a)
if (days > tot):
    print(days-tot)
elif (days == tot):
    print(days-tot)
else:
    print('-1')

Buggy submission (verdict: Runtime Error):
days , assi = map(int,input().split())
lst = []
while(assi > 0):
    a = int(input())
    assi -= 1
    lst.append(a)
    tot = sum(lst)
if (days > tot):
    print(days-tot)
elif (days == tot):
    print(days-tot)
else:
    print('-1')

Buggy submission (verdict: Runtime Error):
days = int(input())
assi = int(input())
lst = []
while(assi > 0):
    a = int(input())
    assi -= 1
    lst.append(a)
    tot = sum(lst)
if (days > tot):
    print(days-tot)
elif (days == tot):
    print(days-tot)
else:
    print('-1')

Buggy submission (verdict: Runtime Error):
days = int(input())
assi = int(input())
lst = []
while(assi > 0):
    a = int(input())
    assi -= 1
    lst.append(a)
    tot = sum(lst)
if (days > tot):
    print(days-tot)
elif (tot == days):
    print(days-tot)
else:
    print('-1')
Problem p02640 (python)

Fixed submission:
x,y = map(int,input().split())

if y % 2 == 0 and y >= 2 * x and y <= 4 * x:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())

if x >= 51:
    print("No")
    sys.exit

if y % 2 == 0 and y >= 2 * x and y <= 4 * x:
    print("Yes")
else:
    print("No")
Problem p02612 (python)

Fixed submission:
N = int(input())
R = N % 1000
if R == 0:
    print(0)
else:
    print(abs(R-1000))

Buggy submission (verdict: Runtime Error):
N = input()
R = N % 1000
if R == 0:
    print(0)
else:
    print(abs(R-1000))

Buggy submission (verdict: Runtime Error):
N = int(input())
if N%1000 == 0:
    print(0)
else:
    x = int(abs((n % 1000) - 1000))
    print(x)

Buggy submission (verdict: Runtime Error):
N = int(input())
R = N % 1000
if R = 0:
    print(0)
else:
    print(abs(R-1000))

Buggy submission (verdict: Runtime Error):
N = input()
R = N % 1000
if R = 0:
    print(0)
else:
    print(abs(R-1000))

Buggy submission (verdict: Runtime Error):
N = input()
R = N % 1000

if R = 0:
    print(0)

else:
    print(abs(R-1000))

Buggy submission (verdict: Runtime Error):
N = input()
R = N%1000

if R == 0:
    print(0)

else :
    print(abs(R-1000))
Problem p02687 (python)

Fixed submission:
contest_1 = "ABC"
contest_2 = "ARC"

S = input()

if S == contest_1:
    print(contest_2)
else:
    print(contest_1)

Buggy submission (verdict: Runtime Error):
contest_1 == "ABC"
contest_2 == "ARC"

S = input()

if S == contest_1:
    print(contest_2)
else:
    print(contest_1)
Problem p02705 (python)

Fixed submission:
from math import pi

R = int(input())

print(2*pi*R)

Buggy submission (verdict: Runtime Error):
R = map(int, input())

cir = 2*R*3.1415

ptint(cir)
Problem p02612 (python)

Fixed submission:
n = (input())
x, y = divmod(int(n), 1000)
if y == 0:
    print(0)
else:
    ans = (1000 * (x + 1)) - int(n)
    print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
dict = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}
for _ in range(n):
    s = input()
    if s in dict:
        dict[s] = dict[s] + 1
for k, l  in dict.items():
    print(k + ' x ' + str(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
dict = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}
for _ in range(n):
    s = input()
    if s in dict:
        dict[s] = dict[s] + 1
for k, l  in dict.items():
    print(k + ' x ' + str(l))
Problem p02621 (python)

Fixed submission:
a = input()
print(str(int(a) + int(a)**2 + int(a)**3))

Buggy submission (verdict: Runtime Error):
import numpy as np
S = input()
T = input()
s = []
t = []
i = 0
for i in range(len(S)):
    s.append(ord(S[i]))
    i += 1
i = 0
for i in range(len(T)):
    t.append(ord(T[i]))
    i += 1
    
s = np.array(s)
t = np.array(t)
print(len(S) - np.count_nonzero(s == t))
Problem p03399 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())

if A <= B:
    densya = A

else:
    densya = B

if C <= D:
    bus = C

else:
    bus = D

untin = densya + bus

print(untin)

Buggy submission (verdict: Runtime Error):
B = int(input())
C = int(input())
D = int(input())

if A <= B:
    densya = A

else:
    densya = B

if C <= D:
    bus = C

else:
    bus = D

untin = densya + bus

print(untin)

Buggy submission (verdict: Runtime Error):
B = int(input())
C = int(input())
D = int(input())

if A <= B:
    densya = A

else:
    densya = B

if C <= D:
    bus = C

else:
    bus = D

untin = densya + bus

print(untin)
Problem p03860 (python)

Fixed submission:
a, b, c = input().split()
    
str = a[0] + b[0] + c[0]
print(str)

Buggy submission (verdict: Runtime Error):
a, b, c = input().split()
    
print("A", b[1], "C")
Problem p04043 (python)

Fixed submission:
N = 3

a, b, c = [int(N) for N in input().split() ]

d = 17

mylist = [5, 7]

if ( a in mylist and b in mylist and c in mylist and a + b + c == 17 ):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a, b, c = [int(3) for 3 in input().split() ]

mylist = [5, 7]

if ( a in mylist and b in mylist and c in mylist and a + b + c == 17 ):
    print("YES")
else:
    print("NO")
Problem p02681 (python)

Fixed submission:
A = list(input())
B = list(input())
c = len(B)
del B[c-1]
if A == B:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
c = len(B)
del B[c-1]
if A == B:
  print(Yes)
else:
  print(NO)
Problem p02683 (python)

Fixed submission:
N, M, X = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]
kouho = []
for i in range(2**N):
  skill = [0]*M
  price = 0
  for j in range(N):
    if ((i>>j) & 1):
      skill = [x+y for (x, y) in zip(skill, A[j][1:])]
      price += A[j][0]
  flag = 1
  for k in skill:
    if k < X:
      flag = 0
  if flag:
    kouho.append(price)
if len(kouho):
  print(min(kouho))
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
N, M, X = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]
kouho = []
for i in range(2**N):
  skill = [0]*M
  price = 0
  for j in range(N):
    if ((i>>j) & 1):
      skill = [x+y for (x, y) in zip(skill, A[j][1:])]
      price += A[j][0]
  flag = 1
  for k in skill:
    if k < X:
      flag = 0
  if flag:
    kouho.append(price)
print(min(kouho))
Problem p02687 (python)

Fixed submission:
N = input()
if N == "ABC":
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
S = input()
if S == ABC:
  print("ARC")
else:
  print("ABC")