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

Fixed submission:
h,a = map(int,input().split())
if h%a == 0:
    print(h//a)
else:
    print((h//a)+1)

Buggy submission (verdict: Runtime Error):
h,a = map(int,input().split())
if h%a == 0:
    print(h//a)
else:
print((h//a)+1)
Problem p03068 (python)

Fixed submission:
input()
S=input()
k=int(input())
for s in S:print(s if s==S[k-1] else "*",end="")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
for i in range(len(s)):
  if s[i] != s[k-1]:
    s[i] = "*"
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
for i in range(len(s))
	if s[i] != s[k-1]
  		s[i] = "*"
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
for i in range(length(s))
	if s[i] != s[k-1]
  		s[i] = "*"
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
for i in range(length(s))
	if s[i] != s[k]
  		s[i] = "*"
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
for i in range(length(s))
	if s[i] != s[k]
  		s[i] = *
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
for i in range(length(s))
	if s[i] != s[k]
  		s[i] = *
Problem p03145 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print((a*b)//2)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a*b//2)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a*b/2)

Buggy submission (verdict: Runtime Error):
a = int(input)
b = int(input)
print(a*b/2)
Problem p03239 (python)

Fixed submission:
n,t = map(int,input().split())
ls = [list(map(int,input().split())) for i in range(n)]
ls1 = []
for i in range(n):
    if ls[i][1] <= t:
        ls1.append(ls[i][0])
if len(ls1) == 0:
    print("TLE")
else:
    print(min(ls1))

Buggy submission (verdict: Runtime Error):
n,t = map(int,input().split())
ls = [list(map(int,input().split())) for i in range(n)]
ls1 = []
for i in range(n):
    if ls[i][1] <= t:
        ls1.append(ls[i][0])
print(min(ls1))
Problem p03399 (python)

Fixed submission:
a,b,c,d=[int(input()) for i in range(4)]
print(min(a+c,a+d,b+c,b+d))

Buggy submission (verdict: Runtime Error):
a,b,c,d=[int(input()) for i in range(4)]
ls = list[a+c,a+d,b+c,b+d]
print(min(ls))
Problem p03408 (python)

Fixed submission:
n = int(input())
lsn=[(input()) for i in range(n)]
m = int(input())
lsm=[(input()) for i in range(m)]
ls = []
for i in range(n):
  ls.append(lsn.count(lsn[i])-lsm.count(lsn[i]))
if max(ls) <= 0:
  print(0)
else:
  print(max(ls))

Buggy submission (verdict: Runtime Error):
n = int(input())
lsn=[int(input()) for i in range(n)]
m = int(input())
lsm=[int(input()) for i in range(m)]
ls = []
for i in range(n):
  ls.append(lsn.count(lsn[i])-lsm.count(lsn[i]))
if max(ls) <= 0:
  print(0)
else:
  print(max(ls))
Problem p03470 (python)

Fixed submission:
n = int(input())
ls = [int(input()) for i in range(n)]
ls = set(ls)
print(len(ls))

Buggy submission (verdict: Runtime Error):
n = input()
ls = [int(input()) for i in range(n)]
ls = list(set(ls))
print(len(ls))

Buggy submission (verdict: Runtime Error):
n = input()
ls = [int(input()) for i in range(n)]
ls = set(ls)
print(len(ls))
Problem p03556 (python)

Fixed submission:
print(int(int(input())**.5)**2)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = 0
m = int(n**0.5)
for i in range(np.ceil(m)):
    if i**2 > n:
        break
    a += 1
print(a**2)
Problem p03636 (python)

Fixed submission:
a = input()
b = len(a)
print(a[0]+str(b-2)+a[b-1])

Buggy submission (verdict: Runtime Error):
a = input()
b = len(a)
b = b-2
print(a[0]+b+a[b+1])

Buggy submission (verdict: Runtime Error):
a = input()
b = len(a)
print(a[0]+(b-2)+a[b-1])
Problem p02818 (python)

Fixed submission:
a,b,k=map(int,input().split())
#食べられた後のa
A=a
#食べられた後のb
B=b
K=k

if a>=k:
    A=a-k
    print(A,B)
elif a<k:
    B=b-(k-a)
    A=0
    if k-a>=b:
        B=0
    print(A,B)
else:
    A=0
    B=0
    print(A,B)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
A=a
B=b
if a>=k:
    A=a-k
elif a<k:
    B=b-(k-a)
    A=0
    if B<0
       　B=0
else:
    A=0
    B=0
    
print(A,B)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
A=a
B=b
K=k

if a>=k:
    A=a-k
    print(A,B)
if a<k:
    B=b-(k-a)
    A=0
    if k-a>=b:
        B=0
    print(A,B)
else:
    A,B=0
    print(A,B)
Problem p02789 (python)

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

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

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

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

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

if N == 1 :
	print("Hello World")
else :
  	A = int(input())
    B = int(input())
    print(A + B)
Problem p03264 (python)

Fixed submission:
K = int(input())
 
if K % 2 == 0:
  answer = (K / 2)**2
else:
  answer = ((K + 1) / 2)**2 - ((K + 1) / 2)
 
print(int(answer))

Buggy submission (verdict: Runtime Error):
x1,y1,x2,y2 = map(int, input().split())
ylen = y2 - y1
xlen = x2 - x1

x3 = x2 - ylen
y3 = y2 + xlen
x4 = x3 - xlen
y4 = y3 - ylen

print(str(x3) + " " + str(y3) + " " + str(x4) + " " + str(y4))

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

if K % 2 == 0:
  answer = (K % 2)^2
else:
  answer = ((K + 1) % 2))^2

print(answer)
Problem p03359 (python)

Fixed submission:
a, b = map(int, input().split())
print(a if a <= b else a-1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
print(a if a <= b else a-1)
Problem p03424 (python)

Fixed submission:
n = int(input())
s = list(input().split())
print("Four" if "Y" in s else "Three")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(map(int, input().split()))
print("Four" if "Y" in s else "Three")
Problem p03493 (python)

Fixed submission:
s = int(input())
l = [int(x) for x in list(str(s))]

sum = 0
for i in l:
  if i == 1:
    sum += 1

print(sum)

Buggy submission (verdict: Runtime Error):
s = [int(x) for x in int(input())]

sum = 0
for i in s:
  if i == 1:
    sum += 1

print(sum)
Problem p03556 (python)

Fixed submission:
import math

n = int(input())

print(math.floor(math.sqrt(n)) ** 2)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
a = round(0, sqrt(n))

print(a ** 2)
Problem p03658 (python)

Fixed submission:
n, k = map(int, input().split())
Li = list(map(int, input().split()))
Li.sort(reverse=True)

length = 0
for i, l in enumerate(Li):
  length += l
  if i == k - 1:
    break
    
print(length)

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

length = 0
for l, i in Li:
  length += 0
  if i == k - 1:
    break
    
print(length)
Problem p02760 (python)

Fixed submission:
a1_1, a1_2, a1_3 = map(int, input().split())
a2_1, a2_2, a2_3 = map(int, input().split())
a3_1, a3_2, a3_3 = map(int, input().split())
a_list=[a1_1, a1_2, a1_3, a2_1, a2_2, a2_3, a3_1, a3_2, a3_3]
n = int(input())
b=[]
for i in range(n):
  b_i = int(input())
  b.append(b_i)
  for j, a_j in enumerate(a_list):
    if a_j == b_i:
      a_list[j] = -1
    
if ((a_list[0]==-1 and a_list[1] == -1 and a_list[2] == -1) or
    (a_list[3]==-1 and a_list[4] == -1 and a_list[5] == -1) or
    (a_list[6]==-1 and a_list[7] == -1 and a_list[8] == -1) or
    (a_list[0]==-1 and a_list[3] == -1 and a_list[6] == -1) or
    (a_list[1]==-1 and a_list[4] == -1 and a_list[7] == -1) or
    (a_list[2]==-1 and a_list[5] == -1 and a_list[8] == -1) or
    (a_list[0]==-1 and a_list[4] == -1 and a_list[8] == -1) or
	(a_list[2]==-1 and a_list[4] == -1 and a_list[6] == -1)):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a1_1, a1_2, a1_3 = map(int, input().split())
a2_1, a2_2, a2_3 = map(int, input().split())
a3_1, a3_2, a3_3 = map(int, input().split())
a_list=[a1_1, a1_2, a1_3, a2_1, a2_2, a2_3, a3_1, a3_2, a3_3]
n = int(input())
b=[]
for i in range(n):
  b_i = int(input())
  b.append(b_i)
  for j in range(len(a_list)):
    if a_list[j] == b_i:
      a_list[j] = -1
if ((a_list[0]==-1 and a_list[1] == -1 and a_list[2] == -1) or
    (a_list[3]==-1 and a_list[4] == -1 and a_list[5] == -1) or
    (a_list[6]==-1 and a_list[7] == -1 and a_list[8] == -1) or
    (a_list[0]==-1 and a_list[3] == -1 and a_list[6] == -1) or
    (a_list[1]==-1 and a_list[4] == -1 and a_list[7] == -1) or
    (a_list[2]==-1 and a_list[5] == -1 and a_list[8] == -1):
  print("Yes")
else:
  print("No")
Problem p02802 (python)

Fixed submission:
n, m = map(int, input().split(" "))
nac = 0
npe = 0
cp = 0
is_ac = [False]*n
np_list = [0]*n
for i in range(m):
  p_s, s = input().split(" ")
  p = int(p_s)-1
  cis_ac = is_ac[p]
  
  if cis_ac:
    continue
  if s == "AC":
    nac += 1
    is_ac[p]=True
  else:
    np_list[p] += 1

for i, a in enumerate(is_ac):
  if a:
    npe += np_list[i]
print(str(nac)+" "+str(npe))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split(" "))
nac = 0
npe = 0
cp = 0
is_ac = [False]*n
np_list = [0]*n
for i in range(m):
  p_s, s = input().split(" ")
  p = int(p_s)-1
  cis_ac = is_ac[p]
  
  if cis_ac:
    continue
  if s == "AC":
    nac += 1
    is_ac[p]=True
  else:
    np_list[p] += 1

for a in is_ac:
  if a:
    npe += np_list[a]
print(str(nac)+" "+str(npe))
Problem p03211 (python)

Fixed submission:
a=input()
x=abs(int(a[0])*100+int(a[1])*10+int(a[2])-753)
for i in range(len(a)-2):
    if abs(int(a[i])*100+int(a[i+1])*10+int(a[i+2])-753)<=x:
        x=abs(int(a[i])*100+int(a[i+1])*10+int(a[i+2])-753)
print(x)

Buggy submission (verdict: Runtime Error):
a=input()
x=abs(int(a[0])*100+int(a[1])*10+int(a[2])-753)
for i in range(i-2)
if abs(int(a[i])*100+int(a[i+1])*10+int(a[i+2])-753)<=x:
    x=abs(int(a[i])*100+int(a[i+1])*10+int(a[i+2])-753)
Problem p03244 (python)

Fixed submission:
from collections import Counter
a=int(input())
A=list(map(int,input().split()))
b=[A[i] for i in range(a) if i%2==0]
c=[A[i] for i in range(a) if i%2==1]
if b==c and len(set(b))==1 and len(set(c))==1:
    print(a//2)
else:
    bc=Counter(b).most_common()
    cc=Counter(c).most_common()
    if bc[0][0]==cc[0][0]:
        print(a-max(bc[1][1]+cc[0][1],bc[0][1]+cc[1][1]))
    else: print(a-bc[0][1]-cc[0][1])

Buggy submission (verdict: Runtime Error):
from collections import Counter
# counter（l）.most_common()：リストについて出現回の多い順に（要素、要素数）で返す
a=int(input())
A=list(map(int,input().split()))
bx=[A[i] for i in range(a) if i%2==0]
cx=[A[i] for i in range(a) if i%2==1]
#　全部同じ数の時
if b==c and len(set(b))==1 and len(set(c))==1:
    print(a//2)
else:
    bc=Counter(b).most_common()
    cc=Counter(c).most_common()
    if bc[0][0]==cc[0][0]:
        print(a-max(bc[1][1]+cc[0][1],bc[0][1]+cc[1][1]))
    else: print(a-bc[0][1]-cc[0][1])
Problem p03282 (python)

Fixed submission:
a=input()
k=int(input())
if int(a)<10:
    a=str(int(a)*11)
i=0
x=0
while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
        if k==0:
            x=1
            k=-1
    else: 
        k=-1
print(a[i-x])

Buggy submission (verdict: Runtime Error):
a=input()
k=int(input())
if int(a)<10:
    a=str(int(a)*11)
i=0
x=0
while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
        x=2
    else: 
        k=-1
        x=0
print(a[i-x])

Buggy submission (verdict: Runtime Error):
a=input()
k=int(input())
i=0
while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
    else: k=-1    
print(a[i])

Buggy submission (verdict: Runtime Error):
a=input()
k=int(input())
x=5*pow(10,15)
i=0
while k>0:
    k-=int(str(a)[i])*x
    i+=1
print(str(a)[i-1])

Buggy submission (verdict: Runtime Error):
a=input()
k=int(input())
x=5*math.pow(10,15)
i=0
while k>0:
    k-=int(str(a)[i])*x
    i+=1
print(str(a)[i-1])
Problem p03294 (python)

Fixed submission:
n=int(input())
L=list(map(int, input().split()))
print(sum(L)-n)

Buggy submission (verdict: Runtime Error):
n=int(input())
L=[list(map(int, input().split())) for i in range(D)]
print(sum(L)-n)
Problem p03436 (python)

Fixed submission:
from collections import deque
h,w=map(int,input().split())
maze=[['#' for i in range(w+2)]]+[['#']+[x=='#' for x in input()]+['#'] for i in range(h)]+[['#' for i in range(w+2)]]
f=0
for i in range(1,h+1):
  for j in range(1,w+1):
    if maze[i][j]:
	    f+=1
z=0
pos=deque([(1,1,0)])
while pos:
    x,y,c=pos.popleft()
    if (x,y)==(h,w):
        print(h*w-f-c-1)
        z=1
        break
    elif maze[x][y]:
        continue
    pos.append((x-1, y, c+1))
    pos.append((x+1, y, c+1))
    pos.append((x, y-1, c+1))
    pos.append((x, y+1, c+1))
    maze[x][y] = True
if z==0:
	print(-1)

Buggy submission (verdict: Runtime Error):
from collections import deque
h,w=map(int,input().split())
maze=[['#' for i in range(w+2)]]+[['#']+[x=='#' for x in input()]+['#'] for i in range(h)]+[['#' for i in range(w+2)]]
f=0
for i in range(1,h+1):
  for j in range(1,w+1):
    if maze[i][j]:
	    f+=1

pos=deque([(1,1,0)])
while pos:
    x,y,c=pos.popleft()
    if (x,y)==(h,w):
        z=c
        break
    elif maze[x][y]:
        continue    
    pos.append((x-1, y, c+1))
    pos.append((x+1, y, c+1))
    pos.append((x, y-1, c+1))
    pos.append((x, y+1, c+1))
    maze[x][y] = True
    
print(h*w-f-z-1)
Problem p04001 (python)

Fixed submission:
s=int(input())
S=str(s)
w=len(str(s))-1
l=[]
L=[]
if w==0:
    print(s)
else:
    for i in range(2**w):
        l.append(format(i, '0{}b'.format(w)))
    for e in l:
        q=[]
        x=int(S[0])
        for i in range(len(e)):
            if e[i]=='0':
                x=x*10+int(S[i+1])
            else:
                q.append(x)
                x=int(S[i+1])
        q.append(x)
        L.append(sum(q))
    print(sum(L))

Buggy submission (verdict: Runtime Error):
s=int(input())
S=str(s)
w=len(str(s))-1
l=[]
L=[]
for i in range(2**w):
    l.append(format(i, '0{}b'.format(w)))
for e in l:
    q=[]
    x=int(S[0])
    for i in range(len(e)):
        if e[i]=='0':
            x=x*10+int(S[i+1])
        else:
            q.append(x)
            x=int(S[i+1])
    q.append(x)
    L.append(sum(q))
print(sum(L))

Buggy submission (verdict: Runtime Error):
s=int(input())
S=str(s)
w=len(str(s))-1
l=[]
L=[]
for i in range(2**w):
    l.append(format(i, '0{}b'.format(w)))
for e in l:
    q=[]
    x=int(S[0])
    for i in range(len(e)):
        if e[i]=='0':
            x=x*10+int(S[i+1])
        else:
            q.append(x)
            x=int(S[i+1])
    q.append(x)
    L.append(sum(q))
print(sum(L)
Problem p03447 (python)

Fixed submission:
x, a, b=[int(input()) for i in range(3)]
print((x-a)%b)

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

print((x-a)%b)
Problem p03635 (python)

Fixed submission:
m,n=map(int,input().split())
print((m-1)*(n-1))

Buggy submission (verdict: Runtime Error):
m=int(input())
n=int(input())
print((m-1)*(n-1))
Problem p03777 (python)

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

print("H" if a==b else"D")

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

print("H" if a==b else"D)
Problem p02924 (python)

Fixed submission:
def resolve():
    N = int(input())
    ans = (N-1)*N//2
    print(ans)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    num = list(range(1,N))
    ans = sum(num)
    print(ans)
resolve()
Problem p02945 (python)

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

tasu = A+B
hiku = A-B
kakeru = A *B

ans =0

if tasu >= hiku and tasu >= kakeru:
  ans = tasu
elif hiku >= tasu and hiku >= kakeru:
  ans = hiku
elif kakeru >= tasu and kakeru >= hiku:
  ans = kakeru

print(ans)

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

tasu = A+B
hiku = A-B
kakeru = A *B

ans =0

if tasu >= hiku and tasu >= kakeru:
  ans = tasu
elif hiku >= tasu and hiku >= kakeru:
  ans = hiku
elif kakru >= tasu and kakeru >= hiku:
  ans = kakeru

print(ans)

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

tasu = A+B
hiku = A-B
kakeru = A *B

ans =0

if tasu > hiku and tasu >kakeru:
  ans = tasu
elif hiku > tasu and hiku > kakeru:
  ans = hiku
elif kakru > tasu and kakeru > hiku:
  ans = kakeru

print(ans)
Problem p02947 (python)

Fixed submission:
import collections
def resolve():
    N = int(input())
    S = [input() for i in range(N)]
    ans = 0

    for i in range(N):
        S[i]=str(sorted(S[i]))
    c = collections.Counter(S)
    for i in c.values():
        for j in range(1,i):
            ans += j
    print(ans)
    
resolve()

Buggy submission (verdict: Runtime Error):
from collections import Counter

def verify_anagrams(first_word, second_word):
    def get_counter(s):
        return Counter(s)
 
    return get_counter(first_word) == get_counter(second_word)

N = int(input())

S = [0 for i in range(N)]

for i in range(N):
  S[i] = input()
  
ans = 0

for i in range(N):
  for j in range(i+1,N):
    if S[j].count(S[i][i]) == 0:
      continue
    if verify_anagrams(S[i],S[j]) == True:
      ans += 1

print(ans)
Problem p02969 (python)

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

Buggy submission (verdict: Runtime Error):
n,d=list(map(int, input().split()))
 
d1=d*2+1
print((n+d1-1)/d1)
Problem p03110 (python)

Fixed submission:
N = int(input())
x = [list(input().split()) for i in range(N)]
ans = 0
for i in range(N):
  if x[i][1] == "JPY":
    ans += int(x[i][0])
  elif x[i][1] == "BTC":
    ans += float(x[i][0]) * 380000
print(ans)

Buggy submission (verdict: Runtime Error):
3
100000000 JPY
100.00000000 BTC
0.00000001 BTC
Problem p03351 (python)

Fixed submission:
a,b,c,d = list(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 = list(map(int,input()))
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 = list(map(int,input()))
ans = "No"
if abs(a-c) < d:
  ans = "Yes"
elif abs(a-b) < d and abs(b-c) < d:
  ans = "Yes"
Problem p03386 (python)

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

AK = A+K-1
BK = B-K+1
for i in range(A,A+K):
  if i <= B:
    if i >= A and i <= AK:
      print(i)
for i in range(BK,B+1): 
  if (i <= AK)!=1:
    if i >= BK and i <= B:
      print(i)

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

tmp = n[0]
sum1=1
for i in range(1,S):
  if tmp <= n[i]:
    tmp=n[i]
    sum1=sum1+1
print(sum1)
Problem p03433 (python)

Fixed submission:
N = int(input())
A = int(input())
ans = "No"
if N % 500 <= A:
  ans = "Yes"
print(ans)

Buggy submission (verdict: Runtime Error):
N – int(input())
A – int(input())
ans = "No"
if N % 500 < A:
  ans = "Yes"
print(ans)
Problem p03679 (python)

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

Buggy submission (verdict: Runtime Error):
x,a,b = list(map(int,input().split()))
if b >= c:
  print("delicious")
elif a+b < c:
  print("dangerous")
else:
  print("safe")
Problem p03729 (python)

Fixed submission:
A,B,C = list(map(str,input().split()))
ans="NO"
if A[len(A)-1] == B[0] and B[len(B)-1] == C[0]:
  ans = "YES"
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,C = list(map(input()))
ans="NO"
if A[len(A)-1] == B[0] and B[len(B)-1] == C[0]:
  ans = "YES"
print(ans)
Problem p03730 (python)

Fixed submission:
A,B,C = list(map(int,input().split()))
 
ans = 0
 
for i in range(1,B+1):
  if A*i % B == C:
    ans = 1
 
if ans == 1:
  print("YES")
else :
  print("NO")

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

ans = 0

for i in range(1,B+1):
  if A*i % B == C:
    ans = 1

if ans == 1:
  print(YES)
else :
  print(NO)
Problem p03773 (python)

Fixed submission:
a,b = list(map(int,input().split()))
print(a+b) if 24 > a+b else print(a+b-24)

Buggy submission (verdict: Runtime Error):
a,b = list(map(int,input().split()))
print(a+b) if 24 > a+b else prin(a+b-24)
Problem p04043 (python)

Fixed submission:
A,B,C = list(map(int,input().split()))
if sorted([A,B,C]) == [5,5,7]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A,B,C = list(map(int,input().split()))
if sort([A,B,C]) == [5,5,7]:
  print("YES")
else:
  print("NO")
Problem p03456 (python)

Fixed submission:
a, b = map(int,input().split())
ab = int(str(a) + str(b))
abroot = str(ab**0.5)
if abroot.split(".")[1:][0] == "0":
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
if str(int(str(a) + str(b))**0.5) % 1 == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
if str(int(str(a) + str(b))**0.5) % 1 == "0":
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
if str(int(str(map(int,input().split())[0]) + str(map(int,input().split())[1]))**0.5).split(".")[1:][0] == "0":
    print("Yes")
else:
    print("No")
Problem p02756 (python)

Fixed submission:
from collections import deque
import sys

def main():
    s = sys.stdin.readline().strip()
    qn = int(sys.stdin.readline().strip())
    qs = [input().split() for _ in range(qn)]

    s = deque(s)
    r = 1
    for q in qs:
        if len(q) == 1:
            r = r * -1

        else:
            if q[1] == '1':
                if r == 1:
                    s.appendleft(q[2])
                else:
                    s.append(q[2])
            else:
                if r == 1:
                    s.append(q[2])
                else:
                    s.appendleft(q[2])

    if r == 1:
        print(''.join(s))
    else:
        s.reverse()
        print(''.join(s))

if __name__ == "__main__":
    main()

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

s = str(input())
Q = int(input())

for _ in range(Q):
	qu = input()
	if qu == '1':
		s = s[::-1]
	else:
		_, fi, ci = qu.split()
		if fi == '1':
			s = ci + s
		if fi == '2':
			s += ci
print(s)

Buggy submission (verdict: Runtime Error):
import sys

def main():

    try:
        Ti = n = 0
        S = []
        S = list(map(str, input()))
        Q = map(int, input())
        while n < 6:
            Query = input().split()
            if len(Query) == 1:
                S[0], S[-1] = S[-1], S[0]

            if len(Query) == 3:
                Ti, Fi, Ci = Query
                if Ti == '2':
                    if Fi == '1':
                        S.insert(0, Ci)
                    if Fi == '2':
                        S.append(Ci)
            n+=1
        print(''.join(S))

    except KeyboardInterrupt:
        sys.exit(0)

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

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

if (a + b) >= c:
    print('Yes')
else:
    print('No')

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

if (a + b) <= c:
    print('Yes')
else:
    print('No')