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

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
x,a = a[-1],a[:-1]
temp = []
for i in a:
    temp.append(abs(x/2-i))
y=a[temp.index(min(temp))]
print(x,y)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()
a = a[::-1]


temp=0
z=0
for i in range(int((n+1)/2)):
    for j in range(i+1,n):
        temp=comb(a[i],a[j])
        if z<temp:
            z=temp
            x,y=a[i],a[j]

def comb(m, r):
    if m-r<r:
        k=m-r
    else:
        k=r
    x=1
    for i in range(m,m-k,-1):
        x*=i
    for j in range(1,k+1):
        x/=j
    return int(x)
print(x, y)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()
a = a[::-1]


temp=0
z=0
for i in range((n+1)//2):
    for j in range(i+1,n):
        temp=comb(a[i],a[j])
        if z<temp:
            z=temp
            x,y=a[i],a[j]

def comb(m, r):
    if m-r<r:
        k=m-r
    else:
        k=r
    x=1
    for i in range(m,m-k,-1):
        x*=i
    for j in range(1,k+1):
        x/=j
    return int(x)
print(x, y)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()
a = a[::-1]


temp=0
z=0
for i in range((n+1)//2):
    for j in range(i+1,n):
        temp=comb(a[i],a[j])
        if z<temp:
            z=temp
            x,y=a[i],a[j]

def comb(m, r):
    if m-r<r:
        k=m-r
    else:
        k=r
    x=1
    for i in range(m,m-k,-1):
        x*=i
    for j in range(1,k+1):
        x//=j
    return x
print(x, y)
Problem p03393 (python)

Fixed submission:
s=input()
x=[0 for _ in range(26)]
if len(s)<26:
    for i in range(len(s)):
        x[ord(s[i])-ord('a')]=1
    for j in range(26):
        if x[j]==0:
            k=j
            break
    print("".join([s,chr(ord('a')+k)]))
elif s=="zyxwvutsrqponmlkjihgfedcba":
    print(-1)
else:
    for i in range(2,27):
        if s[-i]<s[-i+1]:
            break
    for j in sorted(s[-i+1:]):
        if j>s[-i]:
            break
    print(s[:-i]+j)

Buggy submission (verdict: Runtime Error):
s=input()
x=[0 for _ in range(26)]
if len(s)<26:
    for i in range(len(s)):
        x[ord(s[i])-ord('a')]=1
    for j in range(len(s)):
        if x[j]==0:
            k=j
            break
    print("".join([s,chr(ord('a')+k)]))
elif s=="zyxwvutsrqponmlkjihgfedcba":
    print(-1)
else:
    mi=-1
    for i in range(1,26):
        if s[i]<s[i-1]:
            x[i]=1
            if mi==-1:
                mi=i
    tx=s[mi-1::]
    mx=min(list(tx))
    print(s[:mi-2]+mx)

Buggy submission (verdict: Runtime Error):
s=input()
x=[0 for _ in range(26)]
if len(s)<26:
    for i in range(len(s)):
        x[ord(s[i])-ord('a')]=1
    for j in range(len(s)):
        if x[j]==0:
            k=j
            break
    print("".join([s,chr(ord('a')+k)]))
elif s=="zyxwvutsrqponmlkjihgfedcba":
    print(-1)
else:
    mi=-1
    for i in range(1,26):
        if s[i]<s[i-1]:
            x[i]=1
            if mi==-1:
                mi=i
    print(s[:mi-2]+mx)
Problem p03408 (python)

Fixed submission:
N = int(input())
a = [input() for i in range(N)]
M = int(input())
b = [input() for i in range(M)]
 
k = [0]
 
for x in a:
  temp = a.count(x)-b.count(x)
  k.append(temp)
for y in b:
  temp = a.count(y)-b.count(y)
  k.append(temp)
print(max(k))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [input() for i in range(N)]
M = int(input())
b = [input() for i in range(M)]
 
k = []
 
for x in a:
	temp = a.count(x)-b.count(x)
    k.append(temp)
print(max(k))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [int(input()) for i in range(N)]
M = int(input())
b = [int(input()) for i in range(M)]

k = []

for x in a:
	temp = a.count(x)-b.count(x)
    k.append(temp)
print(max(k))
Problem p03425 (python)

Fixed submission:
n = int(input())
s =[input() for i in range(n)]
m,a,r,c,h=0,0,0,0,0
for A in s:
    if A[0]=='M':
        m+=1
    elif A[0]=='A':
        a+=1
    elif A[0]=='R':
        r+=1
    elif A[0]=='C':
        c+=1
    elif A[0]=='H':
        h+=1
x = []
for i in [m,a,r,c,h]:
    if i != 0:
        x.append(i)
if len(x)<3:
    print(0)
elif len(x)==3:
    print(x[0]*x[1]*x[2])
elif len(x)==4:
    print(x[0]*x[1]*x[2]+x[0]*x[1]*x[3]+x[0]*x[2]*x[3]+x[1]*x[2]*x[3])
else:
    print(x[0]*x[1]*x[2]+x[0]*x[1]*x[3]+x[0]*x[2]*x[3]+x[1]*x[2]*x[3]
         +x[0]*x[1]*x[4]+x[0]*x[2]*x[4]+x[1]*x[2]*x[4]
         +x[2]*x[3]*x[4]+x[1]*x[3]*x[4]+x[0]*x[3]*x[4])

Buggy submission (verdict: Runtime Error):
n = int(input())
s =[input() for i in range(n)]
m,a,r,c,h=0,0,0,0,0
for A in s:
    if A[0]=='M':
        m+=1
    elif A[0]=='A':
        a+=1
    elif A[0]=='R':
        r+=1
    elif A[0]=='C':
        c+=1
    elif A[0]=='H':
        h+=1
x = []
for i in [m,a,r,c,h]:
    if i != 0:
        x.append(i)
if len(x)<3:
    print(0)
elif len(x)==3:
    print(x[0]*x[1]*x[2])
elif len(x)==4:
    print(x[0]*x[1]*x[2]+x[0]*x[1]*x[3]+x[0]*x[2]*x[3]+x[1]*x[2]*x[3])
else:
    print(x[0]*x[1]*x[2]+x[0]*x[1]*x[3]+x[0]*x[2]*x[3]+x[1]*x[2]*x[3]
         +x[0]*x[1]*x[4]+x[0]*x[2]*x[4]+x[1]*x[2]*x[4]
         +x[3]*x[4]*x[5]+x[2]*x[4]*x[5]+x[1]*x[4]*x[5])
Problem p03474 (python)

Fixed submission:
a, b = list(map(int, input().split()))
try:
    x, y = input().split('-')
    print('Yes') if a==len(x) and b==len(y) else print('No')
except:
    print('No')

Buggy submission (verdict: Runtime Error):
a, b = list(map(int, input().split()))
x, y = input().split('-')
print('Yes') if a==len(x) and b==len(y) else print('No')
Problem p03565 (python)

Fixed submission:
s=input()
t=input()
if len(s)<len(t):
    print("UNRESTORABLE")
else:
    x=[]
    for i in range(len(s)-len(t)+1):
        k=0
        for j in range(len(t)):
            if s[i+j]!=t[j] and s[i+j]!="?":
                k+=1
        if k==0:
            x.append((s[:i]+t+s[(i+len(t)):]).replace("?","a"))
    if len(x)==0:
        print("UNRESTORABLE")
    else:
        x.sort()
        print(x[0])

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
if len(s)<len(t):
    print("UNRESTORABLE")
else:
    x=[]
    for i in range(len(s)-len(t)+1):
        k=0
        for j in range(len(t)):
            if s[i+j]!=t[j] and s[i+j]!="?":
                k+=1
        if k==0:
            x.append((s[:i]+t+s[(i+len(t)):]).replace("?","a"))
if len(x)==0:
    print("UNRESTORABLE")
else:
    x.sort()
    print(x[0])
Problem p03583 (python)

Fixed submission:
n=int(input())
import sys
for a in range(1,3501):
    for b in range(1,3501):
        if 4*a*b -n*a -n*b<=0:
            continue
        c=n*a*b/(4*a*b -n*a -n*b)
        if not 0<c<=3500:
            continue
        if c==int(c):
            print(a,b,int(c))
            sys.exit()

Buggy submission (verdict: Runtime Error):
n=int(input())
import sys
for a in range(1,3501):
    for b in range(1,3501):
        if (4/n-1/a-1/b)<=0:
            continue
        c=n*a*b/(4*a*b -n*a -n*b)
        if not 0<c<=3500:
            continue
        if c==int(c):
            print(a,b,int(c))
            sys.exit()

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=[]
for a in range(1,3501):
    for b in range(1,3501):
        if (4/n-1/a-1/b)==0:
            continue
        c=1/(4/n-1/a-1/b)
        if c==int(c) and c>0:
            ans.append([str(a),str(b),str(int(c))])
            break
print(" ".join(ans[0]))
Problem p03611 (python)

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
m = max(1, min(a))
M = max(a)
ans=[]
for x in range(m,M):
    ans.append(c[x-1]+c[x]+c[x+1])
if m >= M:
    ans.append(n)
print(max(ans))

Buggy submission (verdict: Runtime Error):
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
m = max(1, min(a))
M = max(a)
ans=[]
for x in range(m,M):
    ans.append(c[x-1]+c[x]+c[x+1])
if m == M:
    ans.append(n)
print(max(ans))

Buggy submission (verdict: Runtime Error):
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
ans=[]
m = max(1, min(a))
M = max(a)+1
for x in range(m,M):
    ans.append(c[x-1]+c[x]+c[x+1])
print(max(ans))
Problem p03779 (python)

Fixed submission:
x=int(input())
n=int((2*x)**0.5)
if n*(n-1)<2*x<=n*(n+1):
    print(n)
elif (n-1)*(n-2)<2*x<=n*(n-1):
    print(n-1)
else:
    print(n+1)

Buggy submission (verdict: Runtime Error):
x=int(input())
n=int((2*int(input()))**0.5)
if n*(n-1)<2*x<=n*(n+1):
    print(n)
elif (n-1)*(n-2)<2*x<=n*(n-1):
    print(n-1)
else:
    print(n+1)
Problem p03944 (python)

Fixed submission:
import numpy as np
w, h, n = map(int, input().split())
xya = [list(map(int, input().split())) for i in range(n)]
x,y,a=[],[],[]
for z in xya:
    x.append(z[0])
    y.append(z[1])
    a.append(z[2])
pp = np.array([[1]*w]*h)
for i in range(n):
    if a[i]==1:
        pp[:, :x[i]]=0
    if a[i]==2:
        pp[:, x[i]:]=0
    if a[i]==3:
        pp[(h-y[i]):, :]=0
    if a[i]==4:
        pp[:(h-y[i]), :]=0
print(sum(sum(pp)))

Buggy submission (verdict: Runtime Error):
w, h, n = map(int, input().split())
xya = [list(map(int, input().split())) for i in range(n)]
x,y,a=[],[],[]
for z in xya:
    x.append(z[0])
    y.append(z[1])
    a.append(z[2])
pp = np.array([[1]*w]*h)
for i in range(n):
    if a[i]==1:
        pp[:, :x[i]]=0
    if a[i]==2:
        pp[:, x[i]:]=0
    if a[i]==3:
        pp[(h-y[i]):, :]=0
    if a[i]==4:
        pp[:(h-y[i]), :]=0
print(sum(sum(pp)))
Problem p03945 (python)

Fixed submission:
s=input()
a=0
for i in range(1,len(s)):
    if s[i]!=s[i-1]:
        a+=1
print(a)

Buggy submission (verdict: Runtime Error):
s=input()
a=0
for i in range(1,n):
    if s[i]!=s[i-1]:
        a+=1
print(a)
Problem p02865 (python)

Fixed submission:
num = int(input())
numList = list(range(0, num))
listLength = len(numList)
counter = 0

#print(numList)

m = [0] * 10000000

for i in range(0, listLength):
    m[numList[i]]
    m[numList[i]] += 1

secondCount = 0

for i in range(0, listLength):
    secondCount += m[num - numList[i]]
    if (num - numList[i] == numList[i]):
        secondCount -= 1

print(int(secondCount / 2))

Buggy submission (verdict: Runtime Error):
num = int(input())
numList = list(range(0, num))
listLength = len(numList)
counter = 0

#print(numList)

m = [0] * 1000000

for i in range(0, listLength):
    m[numList[i]]
    m[numList[i]] += 1

secondCount = 0

for i in range(0, listLength):
    secondCount += m[num - numList[i]]
    if (num - numList[i] == numList[i]):
        secondCount -= 1

print(int(secondCount / 2))
Problem p02900 (python)

Fixed submission:

A, B = map(int, input().split())

while B:
    A, B = B, A % B
n = A



if n == 1:
    print(1)
else:
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            while temp%i == 0:
                temp //= i
            arr.append(i)
    if temp != 1:
        arr.append(temp)

    print(len(arr)+1)

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())

n = math.gcd(A, B)


if n == 1:
    print(1)
else:
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            while temp%i == 0:
                temp //= i
            arr.append(i)
    if temp != 1:
        arr.append(temp)

    print(len(arr)+1)

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())

n = math.gcd(A, B)


if n == 1:
    print(1)
else:
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            while temp%i == 0:
                temp //= i
            arr.append(i)
    if temp != 1:
        arr.append(temp)

    print(len(arr)+1)
Problem p02928 (python)

Fixed submission:
N, K = map(int, input().split())
a_array = [int(i) for i in input().split()]

countR=0
countA=0

for i in range(N):
    for j in range(i+1, N):
        if a_array[i] > a_array[j]:
            countR += 1

    for j in range(N):
        if a_array[i] > a_array[j]:
            countA += 1

print(int((countR * K + countA * K * (K-1) // 2)%(10**9+7)))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
a_array = [int(i) for i in input().split()]

countR=0
countA=0

for i in range(N):
    for j in range(i+1, N):
        if a_array[i] > a_array[j]:
            countR += 1

    for j in range(N):
        if a_array[i] > a_array[j]:
            countA += 1

print((countR * K + int(countA * K * (K-1) / 2)))%(10**9+7)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
a_array = [int(i) for i in input().split()]

right_counter = 0
all_counter = 0
multier = K * (K-1) / 2
if multier >= 10 ** 9 + 7:
    multier %= (10 ** 9 + 7)
threshold = -(-(10 ** 9 + 7) // multier)
threshold_right = -(-(10 ** 9 + 7) // K)
for i in range(N):
    a_i = a_array[i]
    left_over = 0
    right_over = 0
    for j in range(i):
        if a_array[j] < a_i:
            left_over += 1
    for j in range(i+1, N):
        if a_array[j] < a_i:
            right_over += 1
    right_counter += right_over
    all_counter += right_over + left_over
    if right_counter >= threshold_right:
        right_counter %= threshold_right
    if all_counter >= threshold:
        all_counter %= threshold
sum = all_counter * multier + right_counter * K
sum %= (10 ** 9 + 7)
print(int(sum))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
a_array = [int(i) for i in input().split()]

right_counter = 0
all_counter = 0
multier = K * (K-1) / 2
if multier >= 10 ** 9 + 7:
    multier %= (10 ** 9 + 7)
threshold = -(-(10 ** 9 + 7) // multier)
threshold_right = -(-(10 ** 9 + 7) // K)
for i in range(N):
    a_i = a_array[i]
    left_over = 0
    right_over = 0
    for j in range(i):
        if a_array[j] < a_i:
            left_over += 1
    for j in range(i+1, N):
        if a_array[j] < a_i:
            right_over += 1
    right_counter += right_over
    all_counter += right_over + left_over
    if right_counter >= threshold_right:
        right_counter %= threshold_right
    if all_counter >= threshold:
        all_counter %= threshold
sum = all_counter * multier + right_counter * K
sum %= (10 ** 9 + 7)
print(sum)
Problem p02909 (python)

Fixed submission:
# python3

def whether_predict(s):
	w_list=["Sunny", "Cloudy", "Rainy"]
	num=w_list.index(s)
	predict_index= (num+1)%3
	return w_list[predict_index]

if __name__ == '__main__':
    input = input()
    print(whether_predict(input))

Buggy submission (verdict: Runtime Error):
# python3
import numpy as np

def atack_survival(N, K, r_list):
	point_list= np.full(N, K)
	for i in r_list:
		point_list= point_list - 1
		point_list[i-1]= point_list[i-1] + 1


	for i in point_list:
		if i <= 0:
			print ("No")
		else:
			print("Yes")

if __name__ == '__main__':
    l = list(map(int, input().split()))
    N=l[0]
    K=l[1]
    Q=l[2]
    result= [int(input()) for i in range(Q)]
    atack_survival(N,K,result)
Problem p02848 (python)

Fixed submission:
num = int(input())
al = input()

newal = ""
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(len(al)):
  if(alp.index(al[i])+num>25):
    newal = newal + alp[(alp.index(al[i])+num)-26]
  else:
    newal = newal + alp[alp.index(al[i])+num]
  
print(newal)

Buggy submission (verdict: Runtime Error):
num = int(input())
al = input()

newal = ""
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(len(al)):
  if(alp.index(al[i])+num>25):
    newal = newal + alp[(alp.index(al[i])+num)-25]
  else:
    newal = newal + alp[alp.index(al[i])+num]
  
print(newal)

Buggy submission (verdict: Runtime Error):
num = int(input())
al = input()

newal = ""
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(len(al)):
  newal = newal + alp[i+num]
  
print(newal)
Problem p03060 (python)

Fixed submission:
n= int(input())
v_list = [int(i) for i in input().split()]
c_list = [int(i) for i in input().split()]

val = 0
for v, c in zip(v_list, c_list):
  if(v>=c):
    val = val + (v-c)
   
print(val)

Buggy submission (verdict: Runtime Error):
n= int(input())
v_list = [int(i) for i in input().split()]
c_list = [int(i) for i in input().split()]

val = 0
for _ in zip(v_list, c_list):
  if(v_list>=c_list):
    val = val + (v_list-c_list)
 
print(val)

Buggy submission (verdict: Runtime Error):
n= int(input())
v_list = [int(i) for i in input().split()]
c_list = [int(i) for i in input().split()]

for _ in zip(v_list, c_list):
  if(v_list>=c_list):
    val = val + (v_list-c_list)

print(val)
Problem p03085 (python)

Fixed submission:
b=input()

if(b=="A"):
    print("T")
if(b=="T"):
    print("A")
if(b=="G"):
    print("C")
if(b=="C"):
    print("G")

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

Fixed submission:
import fractions as math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A, B, C, D = (int(x) for x in input().split())

Cu = B//C       #Cの上限
Cd = -(-A//C)   #Cの下限
Du = B//D       #Dの上限
Dd = -(-A//D)   #Dの下限

#Least common multiple
LCMu = B//(lcm(C,D))
LCMd = -(-A//lcm(C,D))


C_num = Cu - Cd + 1
D_num = Du - Dd + 1
LCM_num = LCMu - LCMd + 1

C_D_num = C_num + D_num - LCM_num
A_B_num = B - A  + 1

ans = A_B_num - C_D_num
print(ans)

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A, B, C, D = (int(x) for x in input().split())

Cu = B//C       #Cの上限
Cd = -(-A//C)   #Cの下限
Du = B//D       #Dの上限
Dd = -(-A//D)   #Dの下限

#Least common multiple
LCMu = B//(lcm(C,D))
LCMd = -(-A//lcm(C,D))
print(lcm(C,D))

C_num = Cu - Cd + 1
D_num = Du - Dd + 1
LCM_num = LCMu - LCMd + 1

C_D_num = C_num + D_num - LCM_num
A_B_num = B - A  + 1

ans = A_B_num - C_D_num
print(ans)

Buggy submission (verdict: Runtime Error):
import math
import sys

sys.setrecursionlimit(10**7) 

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A, B, C, D = (int(x) for x in input().split())

Cu = B//C       #Cの上限
Cd = -(-A//C)   #Cの下限
Du = B//D       #Dの上限
Dd = -(-A//D)   #Dの下限

#Least common multiple
LCMu = B//(lcm(C,D))
LCMd = -(-A//lcm(C,D))

C_num = Cu - Cd + 1
D_num = Du - Dd + 1
LCM_num = LCMu - LCMd + 1

C_D_num = C_num + D_num - LCM_num
A_B_num = B - A  + 1

ans = A_B_num - C_D_num
print(ans)

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A, B, C, D = (int(x) for x in input().split())

Cu = B//C
Cd = -(-A//C)
Du = B//D
Dd = -(-A//D)

LCMu = B//(lcm(C,D))
LCMd = -(-A//lcm(C,D))

C_num = Cu - Cd + 1
D_num = Du - Dd + 1
LCM_num = LCMu - LCMd + 1

C_D_num = C_num + D_num - LCM_num
A_B_num = B - A  + 1

ans = A_B_num - C_D_num
print(ans)

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A, B, C, D = (int(x) for x in input().split())

Cu = B//C       #Cの上限
Cd = -(-A//C)   #Cの下限
Du = B//D       #Dの上限
Dd = -(-A//D)   #Dの下限

#Least common multiple
LCMu = B//(lcm(C,D))
LCMd = -(-A//lcm(C,D))

C_num = Cu - Cd + 1
D_num = Du - Dd + 1
LCM_num = LCMu - LCMd + 1

C_D_num = C_num + D_num - LCM_num
A_B_num = B - A  + 1

ans = A_B_num - C_D_num
print(ans)
Problem p02848 (python)

Fixed submission:
N=int(input())
S=list(input())
A=''
for i in S:
    if ord(i)+N<=ord('Z'):
        A+=chr(ord(i)+N)
    else:
        A+=chr(ord(i)+N-(ord('Z')-ord('A')+1))
print(A)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=list(input())
A=''
for i in S:
    if ord(i)+N<ord('Z'):
        A+=chr(ord(i)+N)
    else:
        A+=chr(ord(i)+N-ord('z'))
print(A)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=list(input())
for i in S:
  S[i]=chr(ord(i)+N)
print(S)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input().split()
for i in S:
    S[i]=chr(ord(i)+N)
print(S)
Problem p02885 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=int(input().split())
print(max(a-b*2,0))
Problem p02886 (python)

Fixed submission:
N=int(input())
d=list(map(int,input().split()))
ans=0
for i in range(N-1):
    for j in range(i+1,N):
        ans+=d[i]*d[j]
print(ans)

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

ans=0
for i in range(N-1):
    for j in range(i+1,N):
        ans+=d[i]*d[j]
print(result)
Problem p02887 (python)

Fixed submission:
N=int(input())
S=input()

ans=0
p=''
for i in range(N):
    if p != S[i]:
        ans += 1
        p=S[i]
print(ans)

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

ans=0
p=''
for i in range(N):
    if p != S[i]:
        result += 1
        p=S[i]
print(ans)
Problem p02888 (python)

Fixed submission:
from bisect import bisect_left
N=int(input())
L=list(map(int,input().split()))

L.sort()
result=0
for i in range(N-2):
    for j in range(i+1,N-1):
        result+=bisect_left(L,L[i]+L[j])-j-1
print(result)

Buggy submission (verdict: Runtime Error):
N=int(inpiut())
L=list(map(int,input().split()))
ans=0
for i in range(N-2):
    for j in range(i,N-1):
        for k in range(j,N):
            if L[i]<L[j]+L[k] and L[j]<L[i]+L[k] and L[k]<L[i]+L[j]:
                ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(inpiut())
L=list(map(int,input().split()))
ans=0
for i in range(N-2):
    for j in range(i,N-1):
        for k in range(j,N):
            if d[i]<d[j]+d[k] and d[j]<d[i]+d[k] and d[k]<d[i]+d[j]:
                ans+=1
print(ans)
Problem p02898 (python)

Fixed submission:
import numpy as np
 
N, K = map(int, input().split())
h_i = list(map(int, input().split()))
h_i = np.array(h_i)
can_ride = h_i[h_i>=K]
print(len(can_ride))

Buggy submission (verdict: Runtime Error):
import numpy as np
 
N, K = map(int, input().split())
h_i = np.array(map(int, input().split()))

can_ride = h_i[h_i>=K]
print(len(can_ride))

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

N = int(input())
K = int(input())
h_i = list(map(int, input().split()))
h_i = np.array(h_i)

can_ride = h_i[h_i>=K]
print(len(can_ride))

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

N = int(input())
K = int(input())
h_i = np.array(map(int, input().split()))

can_ride = h_i[h_i>=K]
print(len(can_ride))

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

N = int(input())
K = int(input())
h_i = np.arry(input().split()) 

can_ride = h_i[h_i>=K]
print(len(can_ride))

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

N = int(input())
K = int(input())
h_i = map(int,input().spilt())

can_ride = h_i[h_i>=K]
print(len(can_ride))
Problem p03206 (python)

Fixed submission:
D = int(input())
st = 'Christmas'
ww = 25-D
ans = st + (' Eve')* ww 
print(ans)

Buggy submission (verdict: Runtime Error):
D = int(input())
st = 'Chritsmas'
ww = 25-D
print(st+(' Eve'*WW))
Problem p03029 (python)

Fixed submission:
A,P = map(int,input().split())
print((3*A + P) // 2)

Buggy submission (verdict: Runtime Error):
A = int(input())
P = int(input())
B = 3*A + P

print(int(B // 2))

Buggy submission (verdict: Runtime Error):
A = int(input())
P = int(input())
B = 3*A + P

print(int(B/2))

Buggy submission (verdict: Runtime Error):
A = int(input())
P = int(input())
B = 3*A + P

print(int(B/3))
Problem p03636 (python)

Fixed submission:
s = input()

print(s[0] + str(len(s)-2) + s[-1])

Buggy submission (verdict: Runtime Error):

    #文字列を受け取る
    s = input()

    #replaceで文字列を置き換え
    print(s.replace('2017', '2018', 1))
    #置き換え回数も指定できる。今回は必要なさそうだけど

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

print(s[0] + str(len(s)-2) + s[-1])

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

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

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

if A*B > C*D:
  print(A*B)
elif A*B < C*D:
  print(C*D)
else:
  print(A*B)
Problem p03852 (python)

Fixed submission:
c=input()

if c=="a" or c=="e" or c=="i" or c=="o" or c=="u":
  print("vowel")
else:
  print("consonant")

Buggy submission (verdict: Runtime Error):
c = input()
if c == a or e or i or o or u:
  print("vowel")
else:
  print("constant")