Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def is_substring(s_char_map, t):
    for char in t:
        if char not in s_char_map:
            return False
    return True


def get_impurity(s, t):
    s_char_map = {}
    
    s_len = len(s)
    for char_idx in range(s_len):
        if s[char_idx] not in s_char_map:
            s_char_map[s[char_idx]] = [char_idx + 1]
        else:
            s_char_map[s[char_idx]].append(char_idx + 1)
    last_idx = -1
    s_length = len(s)
    full_length = 0
    
    if not is_substring(s_char_map, t):
        return -1
    
    for char in t:
        if s_char_map[char][-1] >= last_idx:
            last_idx = list(filter(lambda i: i > last_idx, s_char_map[char]))[0]
            full_length += last_idx - (full_length % s_length)
        else:
            last_idx = s_char_map[char][0]
            full_length += (s_length - (full_length % s_length)) + last_idx
    return full_length

s = input()
t = input()
print(get_impurity(s, t))

Fixed submission:
s = input()
t = input()
d = {i:[] for i in "abcdefghijklmnopqrstuvwxyz"}
for i in range(len(s)):
    d[s[i]].append(i)
for i in t:
    if len(d[i]) == 0:
        print(-1)
        exit()

def binary_search(arr, k):
    l, r = 0, len(arr)-1
    while l <= r:
        m = l+r >> 1
        if arr[m] < k:
            l = m+1
        else:
            r = m-1
    return l

a, b = 0, 0
for i in t:
    j = binary_search(d[i], a)
    if len(d[i]) <= j:
        a = 0
        b += 1
        j = binary_search(d[i], 0)
    a = d[i][j] + 1
print(b * len(s) + a)

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
t = list(input())

f = True
for i in t:
    if(not i in s):
        f = False
i = 0
if(not f):
    print(-1)
else:
    for x in t:
         
        while(s[i % len(s)] != x):
            i+=1
        i+=1
    print(i)







Fixed submission:
s = input()
t = input()
d = {i:[] for i in "abcdefghijklmnopqrstuvwxyz"}
for i in range(len(s)):
    d[s[i]].append(i)
for i in t:
    if len(d[i]) == 0:
        print(-1)
        exit()

def binary_search(arr, k):
    l, r = 0, len(arr)-1
    while l <= r:
        m = l+r >> 1
        if arr[m] < k:
            l = m+1
        else:
            r = m-1
    return l

a, b = 0, 0
for i in t:
    j = binary_search(d[i], a)
    if len(d[i]) <= j:
        a = 0
        b += 1
        j = binary_search(d[i], 0)
    a = d[i][j] + 1
print(b * len(s) + a)
Buggy python submission (verdict: Runtime Error):
def dd():
    a=int(input("a="));
    b=int(input("b="));
    if(a+b>a-b):
        if(a+b>a*b):
            print(a+b);
        
        else:
            print(a*b);
    else:
        if(a-b>a+b):
            if(a-b>a*b):
              print(a-b);
            else:
                print(a*b);
def main():
    dd();
main();


Fixed submission:
a,b=map(int,input().split())
print(max(a+b,max(a-b,a*b)))
Buggy python submission (verdict: Runtime Error):
N=input("enter a number")
list=[]
order=True
check=True
pos=0
temp=0
counter=0
numbers=input("enter the permutation as n digit number")
for number in numbers:
    list.append(int(number))
p0=list[0]


for n in range(1,len(list)):
    #checking is the given permutatoin is in ascendig order or no
    if p0<list[n]:
        p0=list[n]
    else:
        order=False

if order==True:
    print("the given permutation is in ascending order")
if order==False:
    for i in range(1,len(list)+1):
        if i==list[i-1]:
            pass
        else:
            counter+=1
            temp=list[i-1]
            pos=list.index(i)           #swap
            list[i-1]=list[pos]
            list[pos]=temp
if counter==1:
    print("Yes we can sort it in ascending order")
else:
    print("No it cant be sorted in one step")



Fixed submission:
n=int(input());lista_1=[];contador=0;index=0
lista=list(map(int,input().split()))
for i in range(1,n+1):
    lista_1.append(i)
for j in lista:
    aaa=lista_1[index]
    if(j!=aaa):
        contador=contador+1
    index=index+1
if(contador<=2):
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
    input()
    g = input()
    a = list(map(str, g.split()))
    b = list(map(int, g.split()))
    if sorted(b) == b:
        print("YES")
    else:
        m = 0
        for i in range(len(b)):
            if b[i] == sorted(b)[i]:
                m+=1
        if m==len(b)-2:
            print("YES")
        else:
            print("NO")

Fixed submission:
n=int(input());lista_1=[];contador=0;index=0
lista=list(map(int,input().split()))
for i in range(1,n+1):
    lista_1.append(i)
for j in lista:
    aaa=lista_1[index]
    if(j!=aaa):
        contador=contador+1
    index=index+1
if(contador<=2):
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a1 = sum(A)
for i in range(N):
  b = B[i]
  if A[i] >= b:A[i] -= b
  else:
    if A[i+1]+A[i] >= b:
      A[i+1] = A[i+1]+A[i]-b
      A[i] = 0
    else:A[i], A[i+1] = 0, 0
a2 = sum(A)
print(a1-a2)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
res = 0
for i in range(n):
    t1 = min(a[i], b[i])
    a[i] -= t1
    b[i] -= t1
    res += t1
    t2 = min(a[i+1], b[i])
    a[i+1] -= t2
    b[i] -= t2
    res += t2
print(res)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
res = 0
for i in range(n):
    t1 = min(a[i], b[i])
    a[i] -= t1
    b[i] -= t1
    res += t
    t2 = min(a[i+1], b[i])
    a[i+1] -= t2
    b[i] -= t2
    res += t2
print(res)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
res = 0
for i in range(n):
    t1 = min(a[i], b[i])
    a[i] -= t1
    b[i] -= t1
    res += t1
    t2 = min(a[i+1], b[i])
    a[i+1] -= t2
    b[i] -= t2
    res += t2
print(res)
Buggy python submission (verdict: Runtime Error):
s = input()
x1 = y1 = x2 = y3 = 0
y2 = 1
print(str(x1) + ' ' +str(y1) + ' ' +str(x2) + ' ' +str(y2) + ' ' + s + ' ' + str(y3))

Fixed submission:
from math import ceil


S = int(raw_input())

x2 = y3 = int(ceil(S ** 0.5))

y2 = x2 * y3 - S 
x3 = 1

print 0, 0, x2, y2, x3, y3

Buggy python submission (verdict: Time Limit Exceeded):
s = int(input())
a, b = -1, -1
for i in range(1, int(s**.5)+1):
    if s % i == 0:
        a, b = i, s//i
print(0, 0, 0, a, b, 0)


Fixed submission:
from math import ceil


S = int(raw_input())

x2 = y3 = int(ceil(S ** 0.5))

y2 = x2 * y3 - S 
x3 = 1

print 0, 0, x2, y2, x3, y3

Buggy python submission (verdict: Runtime Error):

import math
s = int(input())
p=q=0
c=1
a = int (math.sqrt(s))
if (a*a == s):
    d = a

else:
    a+=1
    d = a
    #print(a*d, s)
    b = a*d - s
    #print(a*d - b)

print(p,q,a,b,c,d)

Fixed submission:
from math import ceil


S = int(raw_input())

x2 = y3 = int(ceil(S ** 0.5))

y2 = x2 * y3 - S 
x3 = 1

print 0, 0, x2, y2, x3, y3
Buggy python submission (verdict: Runtime Error):
x, a = map(int, input())
if x < a:
    print(0)
else:
    print(1)

Fixed submission:
x,a=input().split()
if x < a:
    print(0)
else:
    print(10)
Buggy python submission (verdict: Runtime Error):
line1 = input()
line2 = input()
D = 0
res = 0
for i in range(int(line1[0])):
    if D <= int(line1[2]):
        res += 1
    else:
        break
    D = D + int(line2[2*i])
if D <= int(line1[2]):
    res += 1
print(res)

Fixed submission:
n, x = map(int, input().split())
l = [int(i) for i in input().split()]
d = [0]
cnt = 1
while cnt != n + 1 and d[-1] <= x:
	d.append(d[-1] + l[cnt - 1])
	cnt += 1
if d[-1] <= x: 
	print(cnt)
else:
	print(cnt - 1)
Buggy python submission (verdict: Runtime Error):
coordinates = list(map(int, input().split()))
w = coordinates[0]
h = coordinates[1]
x = coordinates[2]
y = coordinates[3]
prod1 = x * h
prod2 = y * w
if x == w and y == h:
    prod1 = prod2 = (w * h) / 2
area = min(prod1, prod2)
# area = format(area, '.6f')
addit = 0 if prod1 != prod2 else 1
print(f"{area} {addit}")

Fixed submission:
import sys
from math import ceil

def input():
    return sys.stdin.readline().strip()

def iinput():
    return int(input())

def finput():
    return float(input())

def tinput():
    return input().split()

def rinput():
    return map(int, tinput())

def rlinput():
    return list(rinput())

def nok(a, b):
    m = a * b
    while a != 0 and b != 0:
        if a > b:
            a %= b
        else:
            b %= a
    return m // (a + b)    


def main():
    w, h, x, y = rinput()
    if x == w / 2 and y == h / 2:
        print(w * h / 2, 1)
    else:
        print(w * h / 2, 0)
    
    
    
main()
Buggy python submission (verdict: Runtime Error):
valores = [int(input()), int(input()), int(input())]
valores.remove(max(valores))
print(valores[0]+valores[1])


Fixed submission:
a = [int(x) for x in input().split()]
a.sort()
print(a[0] + a[1])

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

a.sort()
return(a[0]+a[1])

Fixed submission:
a = [int(x) for x in input().split()]
a.sort()
print(a[0] + a[1])
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
# s = list('ABCABC')
# s = list('ABCACCBABCBCAABCB')

# count = 0
#
# if len(s) < 3:
# 	print(0)
ccc = 0
# while :

i = 0
if len(s) >= 3:
    while i + 2 < len(s):
        if s[i] == 'A':
            if s[i + 1] == 'B' and s[i + 2] == 'C':
                s[i: i + 3] = ['B', 'C', 'A']
                ccc += 1
                if i - 2 >= 0:
                    i -= 2
                else:
                    i = 0
        i += 1
        # print(i)
        # print(s)
# print(s)
print(ccc)


Fixed submission:
s = raw_input()

count = 0
a = 0
i = 0
l = len(s)
while i < len(s):
    if s[i] == 'A':
        a += 1
        i += 1
        continue

    if s[i] == 'B' and i < l - 1 and s[i + 1] == 'C':
        count += a
        i += 2
    else:
        a = 0
        i += 1

print count
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A >= 0 and  A <= 5:
    print(0)
if A >= 6  and A <= 12:
    print(B//2)
if A >= 13 and A <= 100:
    print(B)

Fixed submission:
line = input()
a, b = [int(n) for n in line.split()]
if a>=13:
    print(b)
elif a>=6:
    b = b/2
    b = int(b)
    print(b)
else:
    print("0")

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a >= 0 and  a <= 5:
    print(0)
if a >= 6  and a <= 12:
    print(b//2)
if a >= 13 and a <= 100:
    print(b)

Fixed submission:
line = input()
a, b = [int(n) for n in line.split()]
if a>=13:
    print(b)
elif a>=6:
    b = b/2
    b = int(b)
    print(b)
else:
    print("0")

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if 0 <= a <= 5:
    print(0)
if 6 <= a <= 12:
    print(b//2)
if 16 <= a <= 100:
    print(b)

Fixed submission:
line = input()
a, b = [int(n) for n in line.split()]
if a>=13:
    print(b)
elif a>=6:
    b = b/2
    b = int(b)
    print(b)
else:
    print("0")
Buggy python submission (verdict: Runtime Error):
q = list(map(int, input().split()))
print(max(q) * 2 - (q[1] != q[2]))

Fixed submission:
x = input().split()
A = int(x[0])
B = int(x[1])
if (A > B):
  print((A*2) - 1)
elif (A == B):
  print(A * 2)
else:
  print((B*2) - 1)
Buggy python submission (verdict: Runtime Error):
def sonu(a,count,pivot):
    if(a[pivot]!=a[pivot+1]):
        a.pop(pivot)
        a.pop(pivot)
        pivot=0
        count+=1
        if(len(set(a))!=1 and len(a)!=0):
            sonu(a,count,pivot)
        else:
            print(count*2)
        

    else:
        
        pivot+=1
        if(len(set(a))!=1):
            sonu(a,count,pivot)
        else:
            print(count*2)
        
    
    




a=list(input())
if(len(a)==1):
    print(0)
else:
    count=0
    pivot=0
    sonu(a,count,pivot)
            


Fixed submission:
def main(s):
    a = s.count("0")
    b = s.count("1")
    return 2*min(a,b)

s = input()


print(main(s))

Buggy python submission (verdict: Runtime Error):
for a in Str:
    Codigo.append(a)

lenMax=len(Codigo)-1
k=0

while i < len(Codigo)-1:
    lenAnterior = len(Codigo)-1
    
    if Codigo[i] == "0" and Codigo[i+1]=="1":
        contador+=2
        Codigo.pop(i)
        Codigo.pop(i)
    elif Codigo[i] == "1" and Codigo[i+1]=="0":
        contador+=2
        Codigo.pop(i)
        Codigo.pop(i)
        
    if lenAnterior != len(Codigo)-1:
        i=i-1
    else:
        i=i+1

    k+=1

    if k >= lenMax:
        break
    
print(contador)

Fixed submission:
def main(s):
    a = s.count("0")
    b = s.count("1")
    return 2*min(a,b)

s = input()


print(main(s))

Buggy python submission (verdict: Time Limit Exceeded):
s=list(input())
for i in range(0,len(s)):
    s[i]=int(s[i])
    
adj=-1
op=0
while(adj==-1):
    adj=0
    for i in range(1,len(s)):
        if((s[i]==0 and s[i-1]==1) or (s[i]==1 and s[i-1]==0)):
            adj=-1
            s[i]=2
            s[i-1]=2
            op+=2
    while True:
        try:
            s.remove(2)
        except:
            break
            
print(op)


Fixed submission:
def main(s):
    a = s.count("0")
    b = s.count("1")
    return 2*min(a,b)

s = input()


print(main(s))
Buggy python submission (verdict: Runtime Error):
a, b, c = input().split(' ')
a = int(a)
b = int(b)
c = int(c)
area = int((a*b)/2)
print(area)

Fixed submission:
inp = input()
ab, bc, ca = [int(n) for n in inp.split()]
print(int(ab*bc/2))
Buggy python submission (verdict: Runtime Error):

def main():
    global n, peso, dp

    n = int(input())
    peso = [int(x) for x in input().split()]
    dp = [-1]*(10**5 + 1)
    
    peso.append(10**9)
    peso.append(10**9)
    
    print(frog(0))
    
def frog(i):
    global n, peso, dp
    
    if i >= n - 1:
        return 0

    if dp[i] != -1:
        return dp[i]

    dp[i] = min(abs(peso[i + 1] - peso[i]) + frog(i + 1),
                abs(peso[i + 2] - peso[i]) + frog(i + 2))
    
    return dp[i]

main()

Fixed submission:
from sys import stdin
n = int(stdin.readline())
h = [int(i) for i in stdin.readline().split(' ')]

minCosts = [0, abs(h[1]-h[0])]
for i in range(2, len(h)):
    minCosts.append(min(abs(h[i]-h[i-2])+minCosts[i-2], abs(h[i]-h[i-1])+minCosts[i-1]))

print(minCosts[-1])

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
dp = [0,abs(h[0]-h[1])]
for i in range(2,n): 
dp.append(min(dp[-1]+abs(h[i]-h[i-1]),dp[-2]+abs(h[i]-h[i-2])))
print(dp[-1])

Fixed submission:
from sys import stdin
n = int(stdin.readline())
h = [int(i) for i in stdin.readline().split(' ')]

minCosts = [0, abs(h[1]-h[0])]
for i in range(2, len(h)):
    minCosts.append(min(abs(h[i]-h[i-2])+minCosts[i-2], abs(h[i]-h[i-1])+minCosts[i-1]))

print(minCosts[-1])
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
a=[input() for i in range(h)]
mod=10**9+7
d=[[0]*w for i in range(h)]
d[0][0]=1
for i in range(h):
    for j in range(w):
        if i+1<h and a[i+1][j]==".":
            d[i+1][j]+=d[i][j]
            d[i+1][j]%=mod
        if j+1<w and a[i][j+1]==".":
            d[i][j+1]+=d[i][j]
            d[i][j+1]%=mod
print(d[-1][-1])


Fixed submission:
def main():
    N = int(input())
    A = []
    B = []
    C = []
    for _ in range(N):
        a, b, c = [int(x) for x in input().split()]
        A.append(a)
        B.append(b)
        C.append(c)
    
    dp = [[0 for i in range(3)] for i in range(N)]
    dp[0][0] = A[0]
    dp[0][1] = B[0]
    dp[0][2] = C[0]
    for i in range(1, N):
        dp[i][0] = A[i] + max(dp[i - 1][1], dp[i - 1][2])
        dp[i][1] = B[i] + max(dp[i - 1][0], dp[i - 1][2])
        dp[i][2] = C[i] + max(dp[i - 1][1], dp[i - 1][0])
    
    print(max(dp[N - 1]))
  
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n,T=map(int, input().split())

x=[]

for i in range(n):
    c,t=map(int, input().split())
    if t<=T:
        x.append((i+1,c))
        
x.sort(key=lambda tup: tup[1])

print(x[0][0])

Fixed submission:
N,T=map(int,input().split())
c=[]
mn=1001
for i in range(N):
    cost,time=map(int,input().split())
    if time<=T:
        c.append(cost)
for i in c:
    if i<=mn:
        mn=i
if len(c)==0:
    print('TLE')
else:
    print(mn)

Buggy python submission (verdict: Runtime Error):
N,T=input().split()
a=0
b=0
i=0
for i in range(int(N)):
    c,t=input().split()
    if int(t)<=int(T):
        while b==0:
            a=c
            b+=1
        if int(c)<int (a):
            a=c
            i+=1
if i==0or a==0:
    print("TLE")
else :
    print(a)

Fixed submission:
N,T=map(int,input().split())
c=[]
mn=1001
for i in range(N):
    cost,time=map(int,input().split())
    if time<=T:
        c.append(cost)
for i in c:
    if i<=mn:
        mn=i
if len(c)==0:
    print('TLE')
else:
    print(mn)

Buggy python submission (verdict: Runtime Error):
N,T=input().split()
a=0
b=0
for i in range(int(N)):
    c,t=input().split()
    if int(t)<=int(T):
        if b==0:
            a=c
            b+=1
        if int(c)<int (a):
            a=c
            i+=1
if a==0:
    print("TLE")
else :
    print(a)
    ckdljfskldklsakldlksafkdshfhkfhsdkfkjdshfjkhskfkjsfkjlsalkjdhkjashdkhJKDHKAJHDKSHDSAHDIUAHFIUAHSFUAHFAULHFLKUASHFKULHSUAKLHDKUHFSUKHN,T=input().split()
a=0
b=0
for i in range(int(N)):
    c,t=input().split()
    if int(t)<=int(T):
        if b==0:
            a=c
            b+=1
        if int(c)<int (a):
            a=c
            i+=1
if a==0:
    print("TLE")
else :
    print(a)
    ckdljfskldklsakldlksafkdshfhkfhsdkfkjdshfjkhskfkjsfkjlsalkjdhkjashdkhJKDHKAJHDKSHDSAHDIUAHFIUAHSFUAHFAULHFLKUASHFKULHSUAKLHDKUHFSUKH

Fixed submission:
N,T=map(int,input().split())
c=[]
mn=1001
for i in range(N):
    cost,time=map(int,input().split())
    if time<=T:
        c.append(cost)
for i in c:
    if i<=mn:
        mn=i
if len(c)==0:
    print('TLE')
else:
    print(mn)

Buggy python submission (verdict: Runtime Error):
N , T = map(int, input().split())
mini = T
x = 0
y = 0
for i in range(N):
    c , t = input().split()
for j in range(N-1):
    if int(t[j])<mini:
        mini = int(t[j])
        x = j
if mini<T:
    print(c[j-1])
else:
    print("TLE")

Fixed submission:
N,T=map(int,input().split())
c=[]
mn=1001
for i in range(N):
    cost,time=map(int,input().split())
    if time<=T:
        c.append(cost)
for i in c:
    if i<=mn:
        mn=i
if len(c)==0:
    print('TLE')
else:
    print(mn)

Buggy python submission (verdict: Runtime Error):
N , T = map(int, input().split())
mini = T
for i in range(N):
    c , t = input().split()
for i in  range(N):
    if int(t[i])<mini:
        mini = int(t[i])
if mini<T:
    print(c[i])
else:
    print("TLE")

Fixed submission:
N,T=map(int,input().split())
c=[]
mn=1001
for i in range(N):
    cost,time=map(int,input().split())
    if time<=T:
        c.append(cost)
for i in c:
    if i<=mn:
        mn=i
if len(c)==0:
    print('TLE')
else:
    print(mn)
Buggy python submission (verdict: Runtime Error):
def ctonum(c):
	alp="qwertyuiopasdfghjklzxcvbnm"
	for i in range(len(alp)):
		if c == alp[i]:
			return i

countS=[0 for i in range(100)]
countT=countS

S,T=input(),input()

for i in range(len(S)):
	countS[ctonum[S[i]]]+=1
	countT[ctonum[T[i]]]+=1
	
countS.sort()
countT.sort()

if countS==countT:
	print("Yes")
else:
	print("No")

Fixed submission:
#!/usr/bin/python
# -*- coding: utf-8 -*-
s = raw_input()
t = raw_input()
dd1 = {}
dd2 = {}
flag = True
for i in xrange(len(s)):
    c1, c2 = s[i], t[i]
    if dd1.get(c1, c2) != c2:
        flag = False
        break
    if dd2.get(c2, c1) != c1:
        flag = False
        break
    dd1[c1] = c2
    dd2[c2] = c1
print 'Yes' if flag else 'No'

Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
s=list(S)
t=list(T)
ss=[]
tt=[]
for i in range(97,123):
    a=s.count(chr(i))
    ss.append(a)
    b=t.count(chr(i))
    tt.append(b)
ss.sort()
tt.sort()
if ss==tt:
    print("Yes")
else:
    print("No")

Fixed submission:
#!/usr/bin/python
# -*- coding: utf-8 -*-
s = raw_input()
t = raw_input()
dd1 = {}
dd2 = {}
flag = True
for i in xrange(len(s)):
    c1, c2 = s[i], t[i]
    if dd1.get(c1, c2) != c2:
        flag = False
        break
    if dd2.get(c2, c1) != c1:
        flag = False
        break
    dd1[c1] = c2
    dd2[c2] = c1
print 'Yes' if flag else 'No'
Buggy python submission (verdict: Runtime Error):
import sys
n = int (input())
words = []
No=" "
for i in range (n) :
    words.append(input())
for x in range(len(words)-1):
    if words.count(words[x]) > 1 or words[x+1][0] != words[x][-1]:
        No="No"
        print (No)
        sys.exit() 
If No != "No":
     print ("Yes")

Fixed submission:
n = int(input())
words = []
won = True
for i in range(n):
    new_word = input()
    if i > 0 and won:
        if new_word in words or new_word[0] != words[i-1][len(words[i-1])-1]:
            won = False
    words.append(new_word)

if won:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n=int(input())
Y=input()
y=list(Y)
last=y[len(y)-1]
m=[]
for i in range(n-1):
    x=input()
    if x in m:
        v=0
    m.append(x)
    z=list(x)
    if last!=z[0]:
        v=0
    last = z[len(y) - 1]
if v==0:
    print('No')
else:
    print('Yes')

Fixed submission:
n = int(input())
words = []
won = True
for i in range(n):
    new_word = input()
    if i > 0 and won:
        if new_word in words or new_word[0] != words[i-1][len(words[i-1])-1]:
            won = False
    words.append(new_word)

if won:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N=int(input())
W=[]
same=[]
for i in range(N):
    W.append(input())

for i in range(len(W)):
    for x in range(i+1,len(W)):
        if W[i]==W[x]:
            same.append(W[i])
  
for i in range(len(W)-1):
    if len(same)!=0:
        print("NO")
        break
    
    if W[i][-1]==W[i+1][0]:
        print("YES")
        break
        
    else:
        print("NO")
        break


Fixed submission:
n = int(input())
words = []
won = True
for i in range(n):
    new_word = input()
    if i > 0 and won:
        if new_word in words or new_word[0] != words[i-1][len(words[i-1])-1]:
            won = False
    words.append(new_word)

if won:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n=input (int()) 
x=0
if n%2==0:
    x=(n/2)*((n/2)+1)
else:
    x=((n//2)+1)**2
print(x)

Fixed submission:
n=int(input())
e=int(n/2)
if n%2:
	o=int(n/2+1)
else:
	o=int(n/2)
	
print (o*e)

Buggy python submission (verdict: Runtime Error):
x=input (int ()) 
c=0
if x%2==0:
    c=(x/2)*((x/2)+1)
else:
    c=((x//2)+1)*2
print(c)

Fixed submission:
n=int(input())
e=int(n/2)
if n%2:
	o=int(n/2+1)
else:
	o=int(n/2)
	
print (o*e)

Buggy python submission (verdict: Runtime Error):
N=int(input("enter number")) 
even=0
odd=0
if N%2==0:
    even=N/2
    odd=N/2
else:
    even=N//2
    odd=(N//2) +1
Print(even*odd)

Fixed submission:
n=int(input())
e=int(n/2)
if n%2:
	o=int(n/2+1)
else:
	o=int(n/2)
	
print (o*e)

Buggy python submission (verdict: Runtime Error):
N=int(input("enter number")) 
Counter1=0
Counter2=0
for i in range(N) :
    if i%2==0:
        Counter1+=1 
    if i%2==1:
        Counter2+=1 
Print(Counter1*Counter2)

Fixed submission:
n=int(input())
e=int(n/2)
if n%2:
	o=int(n/2+1)
else:
	o=int(n/2)
	
print (o*e)

Buggy python submission (verdict: Runtime Error):
team=input()
x=team[0]
flag=0
d=0
for i in range(len(team))
   if team[i]==x:
       flag+=1
   else:
        x=team[i]
        flag=0
   if flag==7:
       print("yes")
       d=1
       break
if d=0:
    print("no")

        
        
       


Fixed submission:
n=int(input())
e=int(n/2)
if n%2:
	o=int(n/2+1)
else:
	o=int(n/2)
	
print (o*e)

Buggy python submission (verdict: Runtime Error):
k=int(input())  
odd=1
even=0
for i in range(2,k+1) 
     if i%2==0:
        even+=1
     else:
           odd+=1
print(odd*even)

Fixed submission:
n=int(input())
e=int(n/2)
if n%2:
	o=int(n/2+1)
else:
	o=int(n/2)
	
print (o*e)

Buggy python submission (verdict: Runtime Error):
K = map(int, input())
if K%2 ==0:
    print((K/2) ** 2)
else:
    print((K**2 - 1)/4)


Fixed submission:
n=int(input())
e=int(n/2)
if n%2:
	o=int(n/2+1)
else:
	o=int(n/2)
	
print (o*e)