Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x=int(input())
y=((2*x)**0.5)//1
y-=1
for i in range(y,y+x):
    if (i+1)*1//2>=x:
        print(i)
        exit()

Fixed submission:
x=int(input())
y=int((x**0.5)//1)
for i in range(y,y+x):
    if (i+1)*i//2>=x:
        print(i)
        exit()
Buggy python submission (verdict: Runtime Error):
k,t=map(int,input().split())
a=[]
for i in range(t):
    a.append(int(input()))
if max(a)*2-sum(a)-1<0:
    print(0) 
else:
    print(max(a)*2-sum(a)-1)

Fixed submission:
k,t=map(int,input().split())
a=list(map(int,input().split()))
if max(a)*2-sum(a)-1<0:
    print(0) 
else:
    print(max(a)*2-sum(a)-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
k = map(int,input().split())
ans = 1
if 0 in k:
  ans = 0
for i in range(n):
  if ans == 0:
    break
  ans *= k[i]
  if ans > 10**18:
    ans == -1
  

Fixed submission:
n = int(input())
k = list(map(int,input().split()))
ans = 1
if 0 in k:
  ans = 0
for i in range(n):
  if ans == 0:
    break
  ans *= k[i]
  if ans > 10**18:
    ans = -1
    break
  
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if a+b >= d:
  print(d)
else:
  print(2a+b-d)

Fixed submission:
a,b,c,d=map(int,input().split())
if a >= d:
  print(d)
elif a+b >= d:
  print(a)
else:
  print(2*a+b-d)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
while abs(n-k) < n:
  n = abs(n-k)
print(n)

Fixed submission:
n,k=map(int,input().split())
l=n//k
m=min(abs(l*k-n),abs((l+1)*k-n))
while n > m:
  n=m
print(n)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0


def factorize(n):
    fct = []
    for i in range(1, n):
        if n % (i + 1) == 0:
            fct.append(i + 1)
    return fct


def check(num, mod):
    if num % mod == 1:
        return 1
    elif num % mod == 0:
        num = num / mod
        return check(num, mod)
    else:
        return 0


nfct = factorize(n)
n_1fct = factorize(n - 1)

ans += len(n_1fct)
for mod in nfct:
  ans += check(n,mod)
print(ans)






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

def check(num, mod):
    if num % mod == 1:
        return 1
    elif num % mod == 0:
        num = num / mod
        return check(num, mod)
    else:
        return 0


nfct = factorize(n)
n_1fct = factorize(n - 1)
if n_1fct != [1]:
  ans += len(n_1fct)
for mod in nfct:
  ans += check(n,mod)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
S=list(map(int,input().split()))
set_S=list(set(S))
ans_stock={}
number={}
for i in set_S:
  number[i] = S.count(i)
comb = 0
for i in set_S:
  comb += number[i]*(number[i]-1)/2

for i in S:
  if i in list(ans_stock.keys()):
    print(ans_stock[i])
  else:
    ans = int(comb -  number[i]*(number[i]-1)/2 +  (number[i]-1)*(number[i]-2)/2)
    print(ans)
    ans_stock[i]=ans


Fixed submission:
from collections import Counter
n=int(input())
S=list(map(int,input().split()))
number=Counter(S)
comb=0
stock={}
for i in list(number.values()):
  comb += i*(i-1)/2
for i in S:
  ans = int(comb - number[i]*(number[i]-1)/2 + (number[i]-1)*(number[i]-2)/2)
  print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,m=map(int,input().split())
price_A=list(map(int,input().split()))
price_B=list(map(int,input().split()))
coupon=[]
for _ in range(m):
  coupon.append(list(map(int,input().split())))
ans=min(price_A)+min(price_B[0])
for i in range(m):
  deprice=price_A[coupon[i][0]-1]+price_B[coupon[i][1]-1]-coupon[i][2]
  if deprice < ans:
    ans = deprice
print(ans)


Fixed submission:
a,b,m=map(int,input().split())
price_A=list(map(int,input().split()))
price_B=list(map(int,input().split()))
coupon=[]
for _ in range(m):
  coupon.append(list(map(int,input().split())))
ans=min(price_A)+min(price_B)
for i in range(m):
  deprice=price_A[coupon[i][0]-1]+price_B[coupon[i][1]-1]-coupon[i][2]
  if deprice < ans:
    ans = deprice
print(ans)
Buggy python submission (verdict: Runtime Error):
=input()
if S=="BBB" or S=="AAA":
  print("No")
else:
  print('Yes')

Fixed submission:
n=input()
if n[0]==n[1] and n[1]==n[2]:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
S=input()
if S=+"BBB" or S=="AAA":
  print("No")
else:
  print('Yes')

Fixed submission:
n=input()
if n[0]==n[1] and n[1]==n[2]:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
ans=input()
n=int(input())
for i in range(n):
  t=input()
  if t=="1":
    ans=ans[::-1]
  else:
    if t[2]=="1":
      ans=t[4]+ans
    else:
      ans=ans+t[4]
print(ans)

Fixed submission:
n=input()
if n[0]==n[1] and n[1]==n[2]:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
s=input()
n=int(input())
front=""
back=""
reverse=False

for i in range(n):
  t=input().split()
  if t[0]=="1":
    reverse=not reverse
  else:
    if (t[1]=="1")and not reverse:
      front=front+t[2]
    elif (t[1]=="2")and reverse:
    else:
      back=back+t[2]
if reverse:
  print(back[::-1]+s+front)
else:
  print(front[::-1]+s+back)


Fixed submission:
S = input()
Q = int(input())
reverse = False
front = ""
end = S

for _ in range(Q):
    I = input().split()
    if I[0] == "1":
        reverse = not reverse
    else:
        if (I[1] == "1") ^ reverse:
            front =front + I[2]
        else:
            end = end + I[2]


if reverse:
    print(end[::-1]+front)
    #print("".join(list(reversed(end)))+front)
else:
    print(front[::-1]+end)
    #print("".join(list(reversed(front)))+end)

Buggy python submission (verdict: Time Limit Exceeded):
ans=input()
n=int(input())
for i in range(n):
  t=input()
  if t[0]=="1":
    ans=ans[::-1]
  else:
    if t[2]=="1":
      ans=t[4]+ans
    else:
      ans=ans+t[4]
print(ans)


Fixed submission:
S = input()
Q = int(input())
reverse = False
front = ""
end = S

for _ in range(Q):
    I = input().split()
    if I[0] == "1":
        reverse = not reverse
    else:
        if (I[1] == "1") ^ reverse:
            front =front + I[2]
        else:
            end = end + I[2]


if reverse:
    print(end[::-1]+front)
    #print("".join(list(reversed(end)))+front)
else:
    print(front[::-1]+end)
    #print("".join(list(reversed(front)))+end)
Buggy python submission (verdict: Runtime Error):
ソースコード 

Copy
Copy
A=[]
flag=0
for i in range(3):
  A.append(list(map(int,input().split())))
n=int(input())
for i in range(n):
  s=int(input())
  for k in range(3):
    if s in A[k]:
      A[k][A[k].index(s)]=0

if A[0]==[0,0,0] or A[1]==[0,0,0] or A[2]==[0,0,0]:
  print("Yes")
  flag=1
elif A[1][1]==0 and A[2][2]==0 and A[0][0]==0:
  print("Yes")
  flag=1
elif A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  print("Yes")
  flag=1
else:
  for i in range(3):
    if A[0][i]==0 and A[1][i]==0 and A[2][i]==0:
      print("Yes")
      flag=1
      break
if flag == 0:
  print("No")

Fixed submission:
A=[list(map(int,input().split())) for i in range(3)]
n=int(input())
for k in range(n):
  s=int(input())
  for i in range(3):
    for j in range(3):
      if s == A[i][j]:
        A[i][j]=0   
if A[0][0]==0 and A[1][0]==0 and A[2][0]==0:
  print("Yes")
   
elif A[0][1]==0 and A[1][1]==0 and A[2][1]==0:
  print("Yes")
elif A[0][2]==0 and A[1][2]==0 and A[2][2]==0:
  print("Yes")
elif [0,0,0] in A:
  print("Yes")
  
elif A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  print("Yes")
  
elif A[0][0]==0 and A[1][1]==0 and A[2][2]==0:
  print("Yes")
  
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N,R=map(int,input().split())
if N < 10:
  print(R+100*(10-n))
else:
  print(R)

Fixed submission:
N,R=map(int,input().split())
if N < 10:
  print(R+100*(10-N))
else:
  print(R)

Buggy python submission (verdict: Runtime Error):
N,R=map(int,input().split())
if N < 10:
  return R+100*(10-n)
else:
  return R

Fixed submission:
N,R=map(int,input().split())
if N < 10:
  print(R+100*(10-N))
else:
  print(R)

Buggy python submission (verdict: Runtime Error):
n,r=map(int,input().split())
if N >= 1 and N < 10:
  return R+100*(10-n)
else:
  return R

Fixed submission:
N,R=map(int,input().split())
if N < 10:
  print(R+100*(10-N))
else:
  print(R)

Buggy python submission (verdict: Runtime Error):
if N >= 1 and N < 10:
  return R+100*(10-n)
else:
  return R

Fixed submission:
N,R=map(int,input().split())
if N < 10:
  print(R+100*(10-N))
else:
  print(R)

Buggy python submission (verdict: Runtime Error):
if N >= 1 and N < 10:
  print(R+100*(10-n))
else:
  print(R)

Fixed submission:
N,R=map(int,input().split())
if N < 10:
  print(R+100*(10-N))
else:
  print(R)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l1 = list()
for i in range(n):
  l1.append(input())
l2 = set(l1)
M = 1
l3 = []
for s in l2:
  if l1.count(s) > M:
    M=l1.count(s)
    l3=[]
    l3.append(s)
  elif l1.count(s) == M:
    l3.append(s)
  else:
    continue
l4=sorted(l3)
for i in range(len(l4)):
  print(l4[i])

Fixed submission:
import collections
n = int(input())
l1 = list()
for i in range(n):
  l1.append(input())
c = collections.Counter(l1)
m = max(c.values())
C = sorted(c.items())
for i in C:
  if i[1]==m:
    print(i[0])
Buggy python submission (verdict: Runtime Error):
print("x"*len(input))

Fixed submission:
s=input()
print("x"*len(s))
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
A=list(map(int,input().split()))
B=[]
C=[]
D=[]
for i in range(n):
  C.append((1+A[i])/2)
  B.append(sum(C))
  if i>=k:
    D.append(B[i]-B[i-k])
  elif i==k-1:
    D.append(B[i])
print(max(D))

Fixed submission:
n,k=map(int,input().split())
p = [(int(s)+1)/2 for s in input().split()]
l = [sum(p[:k])]
for i in range(n-k):
  l.append(l[i]-p[i]+p[i+k])
print(max(l))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
A=list(map(int,input().split()))
B=[]
C=[]
D=[]
for i in A:
  C.append((1+i)/2)
  B.append(sum(C))
for i in range(k,n):
  D.append(B[i]-B[i-k])
print(max(D))

Fixed submission:
n,k=map(int,input().split())
p = [(int(s)+1)/2 for s in input().split()]
l = [sum(p[:k])]
for i in range(n-k):
  l.append(l[i]-p[i]+p[i+k])
print(max(l))

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
A=list(map(int,input().split()))
B=[]
C=[]
for i in range(n-k+1):
  Sum=0
  for j in range(k):
    Sum+=A[i+j]
  B.append(Sum)
  C.append((Sum+k)/2)
print(C[B.index(max(B))])

Fixed submission:
n,k=map(int,input().split())
p = [(int(s)+1)/2 for s in input().split()]
l = [sum(p[:k])]
for i in range(n-k):
  l.append(l[i]-p[i]+p[i+k])
print(max(l))

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
A=list(map(int,input().split()))
B=[]
for i in range(n-k+1):
  Sum=0
  for j in range(k):
    Sum+=A[i+j]
  B.append((Sum+k)/2)
print(max(B))

Fixed submission:
n,k=map(int,input().split())
p = [(int(s)+1)/2 for s in input().split()]
l = [sum(p[:k])]
for i in range(n-k):
  l.append(l[i]-p[i]+p[i+k])
print(max(l))
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
life=sorted(list(map(int,input().split())))
if n<k:
  print(0)
else
  ans=sum(life[k:])
  print(ans)

Fixed submission:
n,k=map(int,input().split())
life=sorted(list(map(int,input().split())),reverse=True)
if n<k:
  print(0)
else:
  ans=sum(life[k:])
  print(ans)
Buggy python submission (verdict: Runtime Error):
def f(n):
  if n=1:
    return(1)
  else:
    f(n)=2f(n-1)+1
    return f(n)
n=int(input())
print(f(n))

Fixed submission:
life=int(input())
count=0
while life>=1:
    life=life/2
    count+=1
print(2**count-1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int,input().strip().split()))

result = 1

if 0 in a:
  print(0)
  exit()
elif max(a) > 10 **18:
  print(-1)
  exit()
else:
  for i in range(N):
    result *= a[i]
  if result > 10**18:
    print(-1)
  else:
    print(result)

Fixed submission:
N = int(input())
a = list(map(int,input().strip().split()))

result = 1

if 0 in a:
  print(0)
  exit()
else:
  for i in range(N):
    result *= a[i]
    if result > 10**18:
      print(-1)
      exit()
  print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int,input().strip().split()))

result = 1

for i in range(N):
  result *= a[i]
if result > 10**18:
  print(-1)
else:
  print(result)

Fixed submission:
N = int(input())
a = list(map(int,input().strip().split()))

result = 1

if 0 in a:
  print(0)
  exit()
else:
  for i in range(N):
    result *= a[i]
    if result > 10**18:
      print(-1)
      exit()
  print(result)
Buggy python submission (verdict: Runtime Error):
N = input()

one_digit = N % 10
if one_digit == 2 or one_digit == 4 or one_digit == 5 or one_digit == 7 or one_digit == 9:
  print("hon")
elif one_digit == 0 or one_digit == 1 or one_digit == 6 or one_digit == 8:
  print("pon")
else:
  print("bon")


Fixed submission:
N = input()
one_digit = int(N) % 10
if one_digit == 2 or one_digit == 4 or one_digit == 5 or one_digit == 7 or one_digit == 9:
  print("hon")
elif one_digit == 0 or one_digit == 1 or one_digit == 6 or one_digit == 8:
  print("pon")
else:
  print("bon")

Buggy python submission (verdict: Runtime Error):
one_digit = N % 10
if one_digit == 2 or one_digit == 4 or one_digit == 5 or one_digit == 7 or one_digit == 9:
  print("hon")
elif one_digit == 0 or one_digit == 1 or one_digit == 6 or one_digit == 8:
  print("pon")
else:
  print("bon")

Fixed submission:
N = input()
one_digit = int(N) % 10
if one_digit == 2 or one_digit == 4 or one_digit == 5 or one_digit == 7 or one_digit == 9:
  print("hon")
elif one_digit == 0 or one_digit == 1 or one_digit == 6 or one_digit == 8:
  print("pon")
else:
  print("bon")
Buggy python submission (verdict: Runtime Error):
import math
from math import pi, sqrt, sin, cos

A = int(input())
B = int(input())
H = int(input())
M = int(input())

theta_H = H / 12 * 2* pi
theta_M = M / 60 * 2* pi

D = sqrt((A*cos(theta_H)-B*cos(theta_M))**2 + (A*sin(theta_H) - B*sin(theta_M))**2)

print(D)

Fixed submission:
import math
from math import pi, sqrt, sin, cos

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

theta_H = H / 12 * 2 * pi + M / 12 / 60 * 2 * pi
theta_M = M / 60 * 2 * pi

D = sqrt((A*sin(theta_H)-B*sin(theta_M))**2+(A*cos(theta_H)-B*cos(theta_M))**2)

print(D)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().strip().split()))

ordered = [i for i in range(1,n+1)]
i = 0
count = 0
if a[count] == ordered[count]:
  tmp = a[count]
  a[count] = a[count+1]
  a[count+1] = tmp
  count += 1
i += 1

for i in range(n):
  if a[i] == ordered[i]:
    tmp = a[i]
    a[i] = a[i+1]
    a[i+1] = tmp
    count += 1
print(count)



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

ordered = [i for i in range(1,n+1)]
i = 0
count = 0

for i in range(n):
  if i == 0:
    if a[i] == ordered[i]:
      tmp = a[i]
      a[i] = a[i+1]
      a[i+1] = tmp
      count += 1
  elif i == n-1:
    if a[i] == ordered[i]:
      tmp = a[i]
      a[i] = a[i-1]
      a[i-1] = tmp
      count += 1  
  else:
    if a[i] == ordered[i]:
      tmp = a[i]
      a[i] = a[i+1]
      a[i+1] = tmp
      count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]

def minkou(a1,a2):
  mod = a1 % a2
  if mod == 0:
    return a2
  else:
    return(minkou(a2,mod))

a1 = a[0]
if len(a) == 1:
  print(a[0])
  exit()
else:
  for i in a[1:]:
    maxkou = a1*i / minkou(a1,i)
    a1 = maxkou
print(int(maxkou))

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

 #最小公倍数
def lcm(a,b):
  return a*b//gcd(a,b)

if len(a) ==0:
  print(a[0])
  exit()
else:
  a1 = a[0]
  for i in a:
    a2 = lcm(a1,i)
    a1 = a2
print(a2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]

def minkou(a1,a2):
  mod = a1 % a2
  if mod == 0:
    return a2
  else:
    return(minkou(a2,mod))

a1 = a[0]
for i in a[1:]:
  maxkou = a1*i / minkou(a1,i)
  a1 = maxkou
print(int(maxkou))
    

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

 #最小公倍数
def lcm(a,b):
  return a*b//gcd(a,b)

if len(a) ==0:
  print(a[0])
  exit()
else:
  a1 = a[0]
  for i in a:
    a2 = lcm(a1,i)
    a1 = a2
print(a2)
Buggy python submission (verdict: Time Limit Exceeded):
K,S = input().strip().split()
K,S = int(K),int(S)

count = 0
for x in range(K+1):
  for y in range(K+1):
    for z in range(K+1):
      if x+y+z == S:
        count += 1
print(count)

Fixed submission:
K,S = input().strip().split()
K,S = int(K),int(S)

count = 0

for x in range(S+1):
  for y in range(S+1-x):
    z = S - x- y
    #print( x,y,z)
    if x <= K and y <= K and z <= K:
      count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
start, end, div = input().strip().split()

count = 0
for i in range(int(start),int(end)+1):
  if i % int(div) == 0:
    count += 1
print(count)

Fixed submission:
start, end, div = list(map(int, input().strip().split()))

count = end // div - start //div

if start % div == 0:
  count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
L, N = input().strip().split()

s = [input() for i in range(int(N))]

result = ""
for i in sorted(s):
  result = result + i
print(result)

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

N = l[0]
L = l[1]

s = [input() for i in range(N)]
result = ""
for i in sorted(s):
  result += i
print(result)
Buggy python submission (verdict: Runtime Error):
A,B = map(int, input.split())
print(A*B)

Fixed submission:
A,B = map(int, input().split())
print(A*B)
Buggy python submission (verdict: Runtime Error):
import networkx as nx
N,M = map(int, input().split())
E = [list(map(input().split())) for i in range(M)]

G = nx.Graph() 
G.add_edges_from(E)
di = nx.predecessor(G, source = 1)

print("yes")
for i in range(2,N+1):
  print(di[i][0])

Fixed submission:
import networkx as nx
N,M = map(int, input().split())
E = [list(map(int,input().split())) for i in range(M)]

G = nx.Graph() 
G.add_edges_from(E)
di = nx.predecessor(G, source = 1)

print("Yes")
for i in range(2,N+1):
  print(di[i][0])
Buggy python submission (verdict: Runtime Error):
S,T = map(str, input().sprit())
if T.startswith(S):
  print("Yes")
else:
  print("No")


Fixed submission:
S = str(input())
T = str(input())

if T.startswith(S):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S,T = open(0).sprit()

if T.startswith(S):
  print("Yes")
else:
  print("No")


Fixed submission:
S = str(input())
T = str(input())

if T.startswith(S):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S = str(input())
T = str(input())

if T.startswith(S):
  print("Yes")
else:
  primt("No")


Fixed submission:
S = str(input())
T = str(input())

if T.startswith(S):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

if T.startswith(S):
  print("Yes")
  
else:
  primt("No")


Fixed submission:
S = str(input())
T = str(input())

if T.startswith(S):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

if T.startswith(S) = True:
  print("Yes")
  
else:
  primt("No")


Fixed submission:
S = str(input())
T = str(input())

if T.startswith(S):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S,T = open(0)

if T.startswith(S) = True:
  print("Yes")
  
else:
  primt("No")


Fixed submission:
S = str(input())
T = str(input())

if T.startswith(S):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S,T = open(0)

if T.startswith(S):
  print("Yes")
  
else:
  primt("No")


Fixed submission:
S = str(input())
T = str(input())

if T.startswith(S):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S,T = str(open(0))
Snum = len(S)

if S == T[:-1]:
  print("Yes")
  
else:
  primt("No")


Fixed submission:
S = str(input())
T = str(input())

if T.startswith(S):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S,T = str(open(0))
Snum = len(S)

if S = T[:Snum]:
  print("Yes")
  
else:
  primt("No")


Fixed submission:
S = str(input())
T = str(input())

if T.startswith(S):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S,T = open(0)
Snum = len(S)

if S = T[:Snum]:
  print("Yes")
  
else:
  primt("No")

Fixed submission:
S = str(input())
T = str(input())

if T.startswith(S):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
S = input()
if S = 'ABC':
  print('ARC')
else:
  print('ABC')

Fixed submission:
S = input()

if S == 'ABC':
  print('ARC')
else:
  print('ABC')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

for i in range(1,N+1):
  print(A.count(i))


Fixed submission:
from collections import Counter

N = int(input())
A = Counter(list(map(int, input().split())))

for i in range(1,N+1):
  print(A[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

for i in range(1,N+1):
  Ai = A.count(i)
  print(Ai)

Fixed submission:
from collections import Counter

N = int(input())
A = Counter(list(map(int, input().split())))

for i in range(1,N+1):
  print(A[i])
Buggy python submission (verdict: Runtime Error):
n = input()
x,y = map(int,input().split())
y = y/2
ans = x + y
print(ans)



Fixed submission:
x,y = map(int,input().split())
y = y/2
ans = x + y
print(int(ans))
Buggy python submission (verdict: Runtime Error):
a, b = input().split()
a = int(a)
ib = 0
for i in range(len(b)):
  ib += int(b[len(b)-i-1]) * 10**i

c = int(a*ib/100)

print(c)


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

a = int(a)
b = int(float(b)*1000)

print(int((a * b) // 1000))

Buggy python submission (verdict: Runtime Error):
a, b = input().split()
a = int(a)
ib = 0
for i in range(len(b)):
  ib += int(b[len(b)-i-1]) * 10**i

c = int(a*b/100)

print(c)

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

a = int(a)
b = int(float(b)*1000)

print(int((a * b) // 1000))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

ful = sum(B)

for i in range(N-1):
  if (A[i+1]-A[i]) == 1:
    ful += C[A[i]]

print(ful)


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

ful = sum(B)

for i in range(N-1):
  if (A[i+1]-A[i]) == 1:
    ful += C[A[i]-1]

print(ful)

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

ful = sum(B)

for i in range(N-1):
  if (A[i+1]-A[i]) == 1:
    ful += C[A[i]]

print(ful)

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

ful = sum(B)

for i in range(N-1):
  if (A[i+1]-A[i]) == 1:
    ful += C[A[i]-1]

print(ful)
Buggy python submission (verdict: Runtime Error):
N = int(input())
B = map(int,input().split())

ans = B[0]
for i in range(N-2):
  ans += max([B[i],B[i+1]])

ans += B[N-2]

print(ans)

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

ans = B[0]
for i in range(N-2):
  ans += min([B[i],B[i+1]])

ans += B[N-2]

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

sd = sorted(d)
low = sd[N/2-1]
up = sd[N/2]
num = up - low
print(num)

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

sd = sorted(d)
low = sd[N//2-1]
up = sd[N//2]
num = up - low
print(num)