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

Fixed submission:
from sys import stdin


def main():
    n = int(stdin.readline())
    a = map(int, stdin.readline().split())
    r = [0] * 13
    for ai in a:
        r[int(ai / 400)] += 1
    min = 0
    for i in range(8):
        if r[i] > 0:
            min += 1
    max = min
    for i in range(8, 13):
        max += r[i]
    if min == 0:
        min = 1
    print(min, max)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from sys import stdin


def main():
    n = int(stdin.readline())
    a = map(int, stdin.readline().split())
    r = [0] * 12
    for ai in a:
        r[int(ai / 400)] += 1
    min = 0
    for i in range(8):
        if r[i] > 0:
            min += 1
    max = min
    for i in range(8, 12):
        max += r[i]
    print(min, max)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from sys import stdin


def main():
    n = int(stdin.readline())
    a = map(int, stdin.readline().split())
    r = [0]*9
    for ai in a:
        r[int(ai / 400)] += 1
    min = 0
    for i in range(8):
        if r[i] > 0:
            min += 1
    max = min + r[8]
    print(min, max)


if __name__ == "__main__":
    main()
Problem p03836 (python)

Fixed submission:
def main():
    sx, sy, tx, ty = map(int, input().split())
    path = []
    path.append(''.join('U' * (ty - sy)))
    path.append(''.join('R' * (tx - sx)))
    path.append(''.join('D' * (ty - sy)))
    path.append(''.join('L' * (tx - sx)))

    path.append('L')
    path.append(''.join('U' * (ty - sy + 1)))
    path.append(''.join('R' * (tx - sx + 1)))
    path.append('D')
    path.append('R')
    path.append(''.join('D' * (ty - sy + 1)))
    path.append(''.join('L' * (tx - sx + 1)))
    path.append('U')

    ans = ''.join(path)
    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    sx, sy, tx, ty = map(int, input().split())
    print(
        ''.join(
            [
                'U' * (ty - sy),
                'R' * (tx - sx),
                'D' * (ty - sy),
                'L' * (tx - sx + 1),
                'U' * (ty - sy + 1),
                'R' * (tx - sx + 1),
                'D',
                'R',
                'D' * (ty - sy + 1),
                'L' * (tx - sx + 1),
                'U'
            ]
        )
    )


if __name__ == "__main__":
    main()
Problem p04025 (python)

Fixed submission:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n = int(input())
    a = list(map(int, input().split()))
    x1 = sum(a) // n
    x2 = x1 + 1
    ans1 = 0
    ans2 = 0
    for ai in a:
        ans1 += (ai - x1) ** 2
        ans2 += (ai - x2) ** 2

    print(min(ans1, ans2))


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Buggy submission (verdict: Runtime Error):
def main():
    input = stdin.buffer.readline
    n = int(input())
    a = list(map(int, input().split()))
    x1 = sum(a) // n
    x2 = x1 + 1
    ans1 = 0
    ans2 = 0
    for ai in a:
        ans1 += (ai - x1) ** 2
        ans2 += (ai - x2) ** 2

    print(min(ans1, ans2))


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
if 0 in A:
    print(0)
    exit(0)
ans = 1
for i in A:
    ans = ans * i
    if ans > pow(10, 18):
        print(-1)
        exit(0)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 1
if 0 in A:
	print(0)
	exit()
for i in A:
	ans = ans * i
	if ans > pow(10, 18):
		print(-1)
		exit()
else:
	print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 1
if 0 in A:
  print(0)
  exit()
for i in A:
  ans = ans * i
  if ans > pow(10, 18):
    print(-1)
    exit()
else:
  print(ans)
Problem p02675 (python)

Fixed submission:
i = int(input())
a = i % 10
if a in [2,4,5,7,9]:
  print('hon')
if a in [0,1,6,8]:
  print('pon')
if a in [3]:
  print('bon')

Buggy submission (verdict: Runtime Error):
i = int(input())
a = i % 10
if a in [2,4,5,7,9]:
  return 'hon'
if a in [0,1,6,8]:
  return 'pon'
if a in [3]:
  return 'bon'
Problem p02900 (python)

Fixed submission:
A,B=map(int,(input().split()))
import fractions 
C=fractions.gcd(A,B)
d = []
for i in range(2, int(C**0.5)+1):
	if C % i == 0:
		d.append(i)
		if i != C // i:
			d.append(C//i)
	
D=sorted(d)[::-1]
if D!=[]:
	j=0
	k=len(D)-1
	while j<k:
 
		if D[j]%D[k]==0:
			D.pop(j)
			k=len(D)-1
		else:
			if j+1<k:
				k-=1
			else:
				j+=1
				k=len(D)-1
	D.append(1)
elif C!=1:
	D=[C,1]
else:
	D=[1]
print(len(D))

Buggy submission (verdict: Runtime Error):

A,B=map(int,(input().split()))
import fractions 
C=fractions.gcd(A,B)
d = []
for i in range(2, int(C**0.5)+1):
	if C%i==0:
		d.append(i)
		if i != C // i:
			d.append(C//i)
if C!=1:
	d.append(C)
D=sorted(d)[::-1]

if len(D)==0:
	kotae=0
elif len(D)==1:
	kotae=1
else:	
	j=0
	k=len(D)-1
	while j<k:
		print(D)
		if D[j]%D[k]==0:
			D.pop(j)
			k=len(D)-1
		else:
			if j+1<k:
				k-=1
			else:
				j+=1
				k=len(D)-1
	kotae=len(D)
print(kotae+1)
Problem p02909 (python)

Fixed submission:
S=input()
if S[0]=="R":
    print("Sunny")
elif S[0]=="S":
    print("Cloudy")
else:
    print("Rainy")

Buggy submission (verdict: Runtime Error):
S=list(input())
K="Yes"
for i in range (0,len(S)):
	if i%2==0:
		if S[i]=="L" :
        	K="No"
			break
		else:
        	continue
	else :
		if S[i]=="R" :
			K="No"
			break
		else:
			continue
print(K)

Buggy submission (verdict: Runtime Error):
S=list(input())
K="Yes"
for i in range (0,len(S)):
	if i%2==0:
	    if S[i]=="L" :
        	K="No"
        	break
        else:
        	continue
    else :
		if S[i]=="R" :
        	K="No"
        	break
    	else:
        	continue
print(K)
Problem p02910 (python)

Fixed submission:
S=list(input())
K="Yes"
for i in range (0,len(S)):
	if i%2==0:
		if S[i]=="L" :
			K="No"
			break
		else:
			continue
	else :
		if S[i]=="R" :
			K="No"
			break
		else:
			continue
print(K)

Buggy submission (verdict: Runtime Error):
S=list(input())

K="Yes"

for i in range (0,len(S)):
	if i%2=0
	    if S[i]=="L" :
        	K="No"
        	break
        else:
        	continue
    else :
		if S[i]=="R" :
        	K="No"
        	break
    	else:
        	continue
print(K)

Buggy submission (verdict: Runtime Error):
S=list(input())
q=len(S)//2+1
i=0
K="Yes"
for i in range (0,q):
    if S[2*i]=="L":
        K="No"
        break
    elif S[2*i+1]=="R":
        K="No"
        break
    else:
        continue
print(K)
Problem p02628 (python)

Fixed submission:
_, k = input().split()
 
prices = list(map(lambda x : int(x), input().split()))
 
prices.sort()
 
sum = 0
for i in range(int(k)):
	sum += prices[i]
print(sum)

Buggy submission (verdict: Runtime Error):
_, k = input().split()
 
prices = list(input().split().map(lambda x : int(x)))
 
prices.sort()
 
sum = 0
for i in range(int(k)):
	sum += prices[i]
print(sum)

Buggy submission (verdict: Runtime Error):
_, k = input().split()
 
prices = input().split().map(lambda x : int(x))
 
prices.sort()
 
sum = 0
for i in range(int(k)):
	sum += prices[i]
print(sum)

Buggy submission (verdict: Runtime Error):
_, k = input().split()
 
prices = input().split().map(lambda x : int(x))
 
prices.sort()
 
sum = 0
for i in range(k):
	sum += prices[i]
print(sum)

Buggy submission (verdict: Runtime Error):
_, k = input().split()

prices = input().split().map(lambda x : int(x))

prices.sort()

sum = 0
for i in range(k):
	sum += prices(i)
print(sum)
Problem p02657 (python)

Fixed submission:
A, B = map(int,input().split())
print(A * B)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input() ,split() )
print(A * B)
Problem p03359 (python)

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

if a<=b:
    print(a)
else:
    print(a-1)

Buggy submission (verdict: Runtime Error):

A,B,C=map(int,input().split())
K=int(input())
a=0
 
if A<=B:
    d=B
else:
    d=A
if d>C: a="aiueo"
else:
	d=C;

if d==A:
	all=B+C
if d==B:
	all=A+C
if d==C:
	all=B+A

while a<K:
	d*=2
	a+=1

all+=d
print (all)

Buggy submission (verdict: Runtime Error):
a,b=map(int ,raw_input().split())

if a<=b:
    print(a)
else:
    print(a-1)

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

if a>b:
 print(a-1)
else:
 print(a)

Buggy submission (verdict: Runtime Error):
a,b=map(int,raw_input().split())

if a>b:
 print(a-1)
else:
 print(a)

Buggy submission (verdict: Runtime Error):
a,b=map(int ,raw_input().split())

if a<=b:
    print(a)
else:
    print(a-1)

Buggy submission (verdict: Runtime Error):
a,b=map(int,raw_input().split())

if a>b:
 print(a-1)
else:
 print(a)

Buggy submission (verdict: Runtime Error):
a,b=map(input().split(" "))

if a>b:
 print(a-1)
else:
 print(a)

Buggy submission (verdict: Runtime Error):
a,b=map(input().split(""))

if a>b:
 print(a-1)
else:
 print(a)

Buggy submission (verdict: Runtime Error):
a=raw_input()
b=raw_input()

if a>b:
 print(a-1)
else:
 print(a)

Buggy submission (verdict: Runtime Error):
a=raw_input()
b=raw_input()

if a>b:
 print(a-1)
else:
 print(a);
Problem p02640 (python)

Fixed submission:
input = input()
 
nums = input.split(" ")
 
animals = int(nums[0])
legs = int(nums[1])
 
turu = (4*animals -legs)/2.0
kame = (legs-2*animals)/2.0
 
if turu.is_integer() and kame.is_integer() and turu>=0 and kame>=0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
2 ans = 'No'
3 for a in range(X + 1):
4 b = X - a
5 if 2 * a + 4 * b == Y:
6 ans = 'Yes'
7 print(ans)
Problem p02628 (python)

Fixed submission:
n, k = tuple(map(int, input().split()))
l = list(map(int, input().split()))
s = sum(sorted(l)[:k])
print(s)

Buggy submission (verdict: Runtime Error):
n, k = tuple(map(int, input.split()))
l = list[map(int, input.split())]
s = sum(l.sort().[:k])
print(s)
Problem p03337 (python)

Fixed submission:
a,b=map(int,input().split())
p=a+b
m=a-b
j=a*b
i=p
if i<m:
  i=m
if i<j:
  i=j
print (i)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
p=a+b
m=a-b
j=a*b
i=p
if i<m:
  i=m
if i<j:
  i=j
print i
Problem p02657 (python)

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

c=a*b
print(c)

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

for i in a :
    p = p * i
    
if p<= 10**18:
    print(p)
else:
    print(-1)

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

for i in range(n):
    p=p*a[i]
    
if p<= 10**18:
    print(p)
    
else:
    print(-1)
Problem p02663 (python)

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

if a==c:
    t=d-b
    if e<=t:
        print(t-e)
    else:
        print(0)
    
if c>a:
    if b>d:
        t=60*(c-a)-b+d
        if e<=t:
            print(t-e)
        else:
            print(0)
        
        
    if b<=d:
        t=(c-a)*60+d-b
        if e<=t:
            print(t-e)
        else:
            print(0)

Buggy submission (verdict: Runtime Error):
(a,b,c,d,e)=map(int,input().split())

if a==c:
    t=d-b
    if e<=t:
        print(t-e)
    else:
        print(0)
    
if c>a:
    if b>d:
        t=60-b+d
        if e<=t:
        print(t-e)
    else:
        print(0)
        
    if b<=d:
        t=(c-a)*60+d-b
        if e<=t:
        print(t-e)
        else:
        print(0)
Problem p02780 (python)

Fixed submission:
N,K=map(int,input().split())
list_pn=list(map(int,input().split()))
# Pnの期待値を計算
pn_ave=[]
for i in range(N):
    pn_ave.append((list_pn[i]+1)/2)
# Sj+k-Sjの累積和を用いて考える
Sj = []
Sj.append(0)
S=0
for i in range(N):
    S += pn_ave[i]
    Sj.append(S)
# print(Sj)
Sk = []
for i in range(N-K+1):
    Sk.append(Sj[i+K]-Sj[i])
# print(Sk)
Sk.sort()
print(Sk[-1])

Buggy submission (verdict: Runtime Error):
#N個のサイコロが左から右に一列に並べてあります。左から i番目のサイコロは 
# 1から piまでの pi種類の目がそれぞれ等確率で出ます。
#隣接する K個のサイコロを選んでそれぞれ独立に振ったとき、出る目の合計の期待値の最大値を求めてください。
N_K=input()
pn=input()
list_pn=[]
# N,K,Pnの切り出し
for i in range(len(N_K)):
    if N_K[i]==" ":
        N =int(N_K[0:i])
        K =int(N_K[i+1:len(N_K)])
a = 0
for i in range(len(pn)):
    if pn[i]==" ":
        list_pn.append(int(pn[a:i]))
        a = i
list_pn.append(int(pn[a+1:len(pn)]))
# Pnの期待値を計算
pn_ave=[]
for i in range(N):
    pn_ave.append((list_pn[i]+1)/2)
# Sj+k-Sjの累積和を用いて考える
Sj = []
Sj.append(0)
S=0
for i in range(N):
    S += pn_ave[i]
    Sj.append(S)
print(Sj)
Sk = []
for i in range(N-K+1):
    Sk.append(Sj[i+K]-Sj[i])
print(Sk)
Sk.sort()
print(Sk[-1])

Buggy submission (verdict: Runtime Error):
N_K=input()
pn=input()
list_pn=[]
# N,K,Pnの切り出し
for i in range(len(N_K)):
    if N_K[i]==" ":
        N =int(N_K[0:i])
        K =int(N_K[i+1:len(N_K)])
a = 0
for i in range(len(pn)):
    if pn[i]==" ":
        list_pn.append(int(pn[a:i]))
        a = i
list_pn.append(int(pn[a+1:len(pn)]))
# Pnの期待値を計算
pn_ave=[]
for i in range(N):
    pn_ave.append((list_pn[i]+1)/2)
# Sj+k-Sjの累積和を用いて考える
Sj = []
Sj.append(0)
S=0
for i in range(N):
    S += pn_ave[i]
    Sj.append(S)
Sk = []
for i in range(N-K+1):
    Sk.append(Sj[i+K]-Sj[i])
Sk.sort()
print(Sk[-1])

Buggy submission (verdict: Runtime Error):
N_K=input()
pn=input()
list_pn=[]
# N,K,Pnの切り出し
for i in range(len(N_K)):
    if N_K[i]==" ":
        N =int(N_K[0:i])
        K =int(N_K[i+1:len(N_K)])
a = 0
for i in range(len(pn)):
    if pn[i]==" ":
        list_pn.append(int(pn[a:i]))
        a = i
list_pn.append(int(pn[a+1:len(pn)]))
# Pnの期待値を計算
pn_ave=[]
for i in range(N):
    pn_ave.append(list_pn[i]*(list_pn[i]+1)/2/list_pn[i])

#最大値を算出
pn_ave_total=[]
for i in range(N-K+1):
    ave = 0
    list_ave = pn_ave[i:i+K]
    for j in range(K):
        ave += list_ave[j]
    pn_ave_total.append(ave)
pn_ave_total.sort()
print(pn_ave_total[-1])

Buggy submission (verdict: Runtime Error):
N_K=input()
pn=input()
list_pn=[]
for i in range(len(N_K)):
    if N_K[i]==" ":
        N =int(N_K[0:i])
        K =int(N_K[i+1:len(N_K)])
a =0
for i in range(len(pn)):
    if pn[i]==" ":
        list_pn.append(int(pn[a:i]))
        a = i
list_pn.append(int(pn[a+1:len(pn)]))
pn_ave=[]
for i in range(N):
    ave =0
    for j in range(list_pn[i]):
        ave += j+1
    pn_ave.append(ave/list_pn[i])
pn_ave_total=[]
total = 0
A = 0
for i in range(N-K+1):        
    while A<K:
        total+=pn_ave[A]
        A += 1
    A = A-2
    K += 1
    pn_ave_total.append(total)
    total=0
pn_ave_total.sort()
print(pn_ave_total[-1])
Problem p02628 (python)

Fixed submission:
n, k = map(int, input().split())
p = sorted(map(int, input().split()))
print(sum(p[:k]))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = sorted(map(int, input().split()))
print(sum([:k]))
Problem p02981 (python)

Fixed submission:
print((lambda n,a,b:min(n*a, b))(*[int(x) for x in input().split()]))

Buggy submission (verdict: Runtime Error):
print((lambda n,a,b:max(n*a, b))(*[int(x) for x in input().split()])
Problem p02885 (python)

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

Buggy submission (verdict: Runtime Error):
print(max(0,eval(input().replace('','-2*'))))
Problem p02957 (python)

Fixed submission:
a=sum(map(int,input().split()));print(a%2*'IMPOSSIBLE'or a//2)

Buggy submission (verdict: Runtime Error):
a=sum(input().split());print(a%2*'IMPOSSIBLE'or a//2)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split());print({a/2+b/2,"IMPOSSIBLE"}[(a+b)%2])
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
(a,b,c)=int(input().split());print(min(a*b,c))

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

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input.split());print(a*b/2)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input());print(a*b/2)
Problem p03206 (python)

Fixed submission:
print("Christmas"+" Eve"*(25-int(input())))

Buggy submission (verdict: Runtime Error):
print("Christmas"+[" Eve"for i in-int(input())%5])

Buggy submission (verdict: Runtime Error):
print("Christmas"+" Eve"*int(input())%5)

Buggy submission (verdict: Runtime Error):
print("Christmas"+" Eve"*(25-int(innput())))
Problem p03210 (python)

Fixed submission:
print("YNEOS"[input()not in'357'::2])

Buggy submission (verdict: Runtime Error):
print("YNEOS"[1-input()in'357'::2])
Problem p03219 (python)

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

Buggy submission (verdict: Runtime Error):
<>=~$";print+$'+$`/2,$/

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

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

Buggy submission (verdict: Runtime Error):
if int(input())==1:print("Hello World")else:print(int(input())+int(input()))

Buggy submission (verdict: Runtime Error):
if int(input())==1
	print("Hello World")
else
	print(int(input())+int(input()))
Problem p03280 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split());pirnt(a*b-a-b+1)
Problem p03351 (python)

Fixed submission:
a,b,c,d=map(int,input().split());print("YNeos"[(abs(a-b)>d or abs(b-c)>d)and abs(a-c)>d::2])

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int.input().split());print("YNeos"[(abs(a-b)>d or abs(b-c)>d)and abs(a-c)>d::2])
Problem p03385 (python)

Fixed submission:
print("YNeos"[len(set(input()))<3::2])

Buggy submission (verdict: Runtime Error):
a=list(ord(input()));print('YNeos'[a[0]^a[1]^a[2]==96::2])

Buggy submission (verdict: Runtime Error):
a=ord(list(input()));print('YNeos'[a[0]^a[1]^a[2]==96::2])

Buggy submission (verdict: Runtime Error):
a=ord(input());print('YNeos'[a[0]^a[1]^a[2]==96::2])

Buggy submission (verdict: Runtime Error):
a=ord(input());print('YNeos'[a[0]^a[1]^a[2]==96])

Buggy submission (verdict: Runtime Error):
a=ord(input());print('YNeos'[a[0]^a[1]^a[2]=='`'])
Problem p03485 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split());print(ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split());print(math.ceil((a+b)/2))
Problem p03501 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=int(input().split());print(min(a*b,c))

Buggy submission (verdict: Runtime Error):
a,b,c=input().split();print(min(a*b,c))
Problem p03657 (python)

Fixed submission:
a,b=map(int,input().split());print(['P','Imp'][a*b*(a+b)%3>0]+'ossible')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())print(('P','Imp')[a*b*(a+b)%3>0]+'ossible')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())print(('P'if a*b*(a+b)%3<0else'Imp')+'ossible')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())print('P'if a*b*(a+b)%3<0else'Imp'+'ossible')
Problem p03693 (python)

Fixed submission:
a,b,c=map(int,input().split());print('YNEOS'[(b*10+c)%4>0::2])

Buggy submission (verdict: Runtime Error):
a,b,c=(int,input().split());print('YNEOS'[(b*10+c)%4>0::2])

Buggy submission (verdict: Runtime Error):
a,b,c=(int,input().split());print('YNEOS'[b*10+c%4>0::2])
Problem p03711 (python)

Fixed submission:
print('YNeos'['2'in input()::2])

Buggy submission (verdict: Runtime Error):
print('YNeos'[2in input()::2])
Problem p03729 (python)

Fixed submission:
a,b,c=map(list,input().split())
print("YNEOS"[a[-1]!=b[0]or b[-1]!=c[0]::2])

Buggy submission (verdict: Runtime Error):
a,b,c=input().split();print('YNEOS'[a[-1]^b[0]^b[-1]^c[0]>0::2])

Buggy submission (verdict: Runtime Error):
a,b,c=input().split();print('YNEOS'[a[-1]^c[0]^b[0]^b[-1]::2])
Problem p03737 (python)

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

Buggy submission (verdict: Runtime Error):
print(a[0],end=""for a in input().upper().split())
Problem p03777 (python)

Fixed submission:
print("$HD"[len(set(input().split()))])

Buggy submission (verdict: Runtime Error):
print("HD"[len(set(input().split()))])
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,b,c,d=[int(input())for i in[0]*4];print(max(a*b,c*d))
Problem p04043 (python)

Fixed submission:
a,b,c=map(int,input().split());print("YNEOS"[a+b+c!=17or a^b^c!=7::2])

Buggy submission (verdict: Runtime Error):
/7 7/cNO
cYES

Buggy submission (verdict: Runtime Error):
print("YES"if input().count(7)==1else"NO")
Problem p02658 (python)

Fixed submission:
def main ():
    N = int(input())
    A = list(map(int,input(). split ()))
    if 0 in A:
        print(0)
        return
    prod = 1
    for a in A:
        prod *= a
        if prod > 1000000000000000000:
            print(-1)
            return
    print(prod)
main ()

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

    if 0 in A:
        print(0)
        return

    prod = 1
    for a in A:
        values *= a
        if prod >  1000000000000000000:
            print('-1')
            return
    print(prod)
main()

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

    if 0 in A:
        print(0)
        return

    prod = 1
    for a in A:
        values *= a
        if prod >  1000000000000000000:
            print('-1')
            return
    print(prod)
main()
Problem p02778 (python)

Fixed submission:
# -*- coding: utf-8 -*-
s=str(input())
n=len(s)
print('x'*n)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
s=str(input())
n=len(n)
print('x'*n)
Problem p04044 (python)

Fixed submission:
N, L = map(int, input().split())
S = []
for _ in range(N):
    S.append(str(input()))
S.sort()

sum_ = ''
for s in S:
    sum_ += s

print(sum_)

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = []
for l in range(L):
    S.append(str(input()))
S.sort()

sum_ = ''
for s in S:
    sum_ += s

print(sum_)
Problem p02681 (python)

Fixed submission:
from math import sqrt


s = input()
t = input()
if(t[:-1] == s):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
from math import sqrt
t = int(input())
for i in range(t):
     s = input()
     t = input()
     if(t[:-1] == s):
         print("YES")
     else:
         print("NO")
Problem p03167 (python)

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

grid=[]
for i in range(n):
    grid.append(list(input()))

dp=[]
for i in range(n):
    dp.append([0]*m)
dp[0][0]=1
for i in range(1,n):
    if(grid[i][0]!="#"):
        dp[i][0]=dp[i-1][0]
    else:
        dp[i][0]=0

for j in range(1,m):
    if(grid[0][j]!="#"):
        dp[0][j]=dp[0][j-1]
    else:
        dp[0][j]=0

for i in range(1,n):
    for j in range(1,m):
        if(grid[i][j]=="#"):
            dp[i][j]=0
        else:
            dp[i][j]=(dp[i-1][j]+dp[i][j-1])%md
print(dp[n-1][m-1])

Buggy submission (verdict: Runtime Error):
md = 1000000007
n,m = map(int,input().split())

grid=[]
for i in range(n):
    grid.append(list(input()))

dp=[]
for i in range(m):
    dp.append([0]*m)
dp[0][0]=1
for i in range(1,n):
    if(grid[i][0]!="#"):
        dp[i][0]=dp[i-1][0]
    else:
        dp[i][0]=0

for j in range(1,m):
    if(grid[0][j]!="#"):
        dp[0][j]=dp[0][j-1]
    else:
        dp[0][j]=0

for i in range(1,n):
    for j in range(1,m):
        if(grid[i][j]=="#"):
            dp[i][j]=0
        else:
            dp[i][j]=(dp[i-1][j]+dp[i][j-1])%md
print(dp[n-1][m-1])
Problem p02628 (python)

Fixed submission:
N, K = map(int,input().split())
p = [int(i) for i in input().split()]
p.sort()
print(sum(p[:K]))

Buggy submission (verdict: Runtime Error):
N, K = input().split()
p = [int(i) for i in input().split()]
p.sort()
print(sum(p[:K+1]))

Buggy submission (verdict: Runtime Error):
a = input()
print("A" if ord(a) < 92 else "a")