Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []

for i in range(n):
    a = input()
    if not a in l:
        l.append(a)
        
print(len(l))

Fixed submission:
n = int(input())
a = [input() for i in range(n)]

l = sorted(a)

count = 1
for i in range(n - 1):
    if l[i] != l[i + 1]:
        count += 1
    
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
l = [0] * n

for i in range(n):
    if a[i] > 0:
        l[a[i] - 1] += 1

for i in range(n):
    print(l[i])

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
l = [0] * n

for i in range(n - 1):
    if a[i] > 0:
        l[a[i] - 1] += 1

for i in range(n):
    print(l[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
l = [0] * n

for i in range(n):
    l[a[i] - 1] += 1
    
for i in range(n):
    print(l[i])

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
l = [0] * n

for i in range(n - 1):
    if a[i] > 0:
        l[a[i] - 1] += 1

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

count = 0
for in range(n):
    if i % 3 > 0 and i % 5 > 0:
        count += i
        
print(count)

Fixed submission:
n = int(input())

count = 0
for i in range(n + 1):
    if i % 3 > 0 and i % 5 > 0:
        count += i
        
print(count)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))

b = sum(a) / 4
count = 0
for i in range(n):
    if a[i] >= b:
      ans += 1
      
if ans >= m:
    print('Yes')
else:
    print('No')

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

b = sum(a) / (4 * m)
ans = 0
for i in range(n):
    if a[i] >= b:
      ans += 1

if ans >= m:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())

a = []
while True:
    n = abs(n - k)
    a.append(n)
    if n <= k // 2:
        break
    
print(min(a))


Fixed submission:
n, k = map(int, input().split())
s = n % k
s2 = k - s
print(min(s, s2))

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())

a = []
while True:
    n = abs(n - k)
    a.append(n)
    if n < k // 2:
        break
    
print(min(a))


Fixed submission:
n, k = map(int, input().split())
s = n % k
s2 = k - s
print(min(s, s2))

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

a = []
for i in range(n):
    n = abs(n - k)
    a.append(n)
    
print(min(a))

Fixed submission:
n, k = map(int, input().split())
s = n % k
s2 = k - s
print(min(s, s2))
Buggy python submission (verdict: Runtime Error):
h, m = map(int, input().split())

count = ((h //2) * m) + ((h %2) *((m //2) + (m %2))
print(count)

Fixed submission:
h, m = map(int, input().split())

if h == 1 or m == 1:
    count = 1
else:
    count = ((h //2) * m) + ((h %2) *((m //2) + (m %2)))
print(count)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

import math
aS = math.ceil(a / 0.08)
al = math.floor((a + 1) / 0.08)
bs = math.ceil(b / 0.10)
bl = math.floor((b + 1) / 0.10)

for i in range(1000):
    if aS <= i < al and bs <= i < bl:
        print(i)
        flag = False
        break
if flag:
    print(-1)

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

import math
aS = math.ceil(a / 0.08)
al = math.floor((a + 1) / 0.08)
bs = math.ceil(b / 0.10)
bl = math.floor((b + 1) / 0.10)

flag = True
for i in range(10000):
    if aS <= i < al and bs <= i < bl:
        print(i)
        flag = False
        break
if flag:
    print(-1)

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

import math
as = math.ceil(a / 0.08)
al = math.floor((a + 1) / 0.08)
bs = math.ceil(b / 0.10)
bl = math.floor((b + 1) / 0.10)

for i in range(1000):
    if as <= i < al and bs <= i < bl:
        print(i)
        break

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

import math
aS = math.ceil(a / 0.08)
al = math.floor((a + 1) / 0.08)
bs = math.ceil(b / 0.10)
bl = math.floor((b + 1) / 0.10)

flag = True
for i in range(10000):
    if aS <= i < al and bs <= i < bl:
        print(i)
        flag = False
        break
if flag:
    print(-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = list(map(int, input().split()))

sum_list = []
start = min(x)
stop = max(x)
for i in range(start, stop):
    sum = 0
    for j in x:
        sum += (i - j) ** 2
    sum_list.append(sum)

print(min(sum_list))


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

sum_list = []
start = min(x)
stop = max(x)
for i in range(1, 100):
    sum = 0
    for j in x:
        sum += (i - j) ** 2
    sum_list.append(sum)

print(min(sum_list))

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

sum_list = []
start = min(x)
stop = max(x)
for i in range(start, stop):
    sum = 0
    for j in x:
        sum += (i - j) ** 2
    sum_list.append(sum)

print(min(sum_list))


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

sum_list = []
start = min(x)
stop = max(x)
for i in range(1, 100):
    sum = 0
    for j in x:
        sum += (i - j) ** 2
    sum_list.append(sum)

print(min(sum_list))

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

sum_list = []
for i in range(min(x), max(x)):
    sum = 0
    for j in x:
        sum += (x[i] - x[j]) ** 2
    sum_list.append(sum)
    
print(min(sum_list))
    

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

sum_list = []
start = min(x)
stop = max(x)
for i in range(1, 100):
    sum = 0
    for j in x:
        sum += (i - j) ** 2
    sum_list.append(sum)

print(min(sum_list))
Buggy python submission (verdict: Runtime Error):
h , a = map(int, input().split())

ans = h // a
if h % a == 0:
    print(ans)
esle:
    print(ans + 1)

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

ans = h // a
if h % a == 0:
    print(ans)
else:
    print(ans + 1)
Buggy python submission (verdict: Time Limit Exceeded):
n  = int(input())
a = list(map(int, input().split()))

count = 1
for i in range(1, n):
    if a[0] == 1:
        break
    elif a[i] <= min(a[:i]):
        count += 1
print(count)


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

count = 0
m = a[0]
for i in range(n):
    if a[i]  <= m:
        m = a[i]
        count += 1
print(count)

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

count = 1
for i in range(1, n):
    if a[i] <= min(a[:i]):
        count += 1
print(count)

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

count = 0
m = a[0]
for i in range(n):
    if a[i]  <= m:
        m = a[i]
        count += 1
print(count)

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

count = 0
for i in range(n):
    if a[i] <= min(a[:i]):
        count += 1
print(count)

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

count = 0
m = a[0]
for i in range(n):
    if a[i]  <= m:
        m = a[i]
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
c = input()

l = [chi(i) for i in range(65, 91)]
print(l[l.index(c) + 1])

Fixed submission:
c = input()

l = [chr(i) for i in range(97, 123)]
print(l[l.index(c) + 1])
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

flag1 = True
flag2 = True
flag3 = True

if a = 1:
    flag1 = False
elif a = 2:
    flag2 = False
elif a = 3:
    flag3 = False
    
if b = 1:
    flag1 = False
elif b = 2:
    flag2 = False
elif b = 3:
    flag3 = False
    
if flag1:
    print(1)
elif flag2:
    print(2)
else:
    print(3)

Fixed submission:
a = int(input())
b = int(input())

flag1 = True
flag2 = True
flag3 = True

if a == 1:
    flag1 = False
elif a == 2:
    flag2 = False
elif a == 3:
    flag3 = False
    
if b == 1:
    flag1 = False
elif b == 2:
    flag2 = False
elif b == 3:
    flag3 = False
    
if flag1:
    print(1)
elif flag2:
    print(2)
else:
    print(3)
Buggy python submission (verdict: Runtime Error):
n = int(input())

import.math

x = n / 1.08
m = math.floor(n * 1.08)

if m == n:
    print(x)
else:
    print(':(')


Fixed submission:
n = int(input())

import math

x = math.ceil(n / 1.08)
m = math.floor(x * 1.08)

if m == n:
    print(int(x))
else:
    print(':(')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

for i in range(len(a)):
    x = a.index(i + 1) + 1
    print(x, end=' ')

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

l = [0] * n

for i in range(n):
    l[a[i] - 1] = i + 1

print(*l)

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

for i in range(n):
    x = a.index(i + 1) + 1
    print(x, end=' ')

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

l = [0] * n

for i in range(n):
    l[a[i] - 1] = i + 1

print(*l)

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

l = []
for i in range(n):
    x = a.index(i + 1) + 1
    l.append(x)

l = list(map(str, l))
print(' '.join(l))

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

l = [0] * n

for i in range(n):
    l[a[i] - 1] = i + 1

print(*l)

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

l = []
for i in range(n):
    x = l.index(i + 1) + 1
    l.append(x)
    
print(' ', join(l))


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

l = [0] * n

for i in range(n):
    l[a[i] - 1] = i + 1

print(*l)

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

l = []
for i in range(n):
    x = index(i + 1) + 1
    l.append(x)
    
print(' ', join(l))

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

l = [0] * n

for i in range(n):
    l[a[i] - 1] = i + 1

print(*l)
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
l = [int(input()) for i in range(q)]

points = [k] * n
for i in range(q):
    points = list(map(lambda x: x - 1, points))
    points[l[i] - 1] += 1
for i in points:
    if i <= 0:
        print('No')
    else:
        print('Yes')


Fixed submission:
n, k, q = map(int, input().split())
l = [int(input()) for i in range(q)]

points = [k - q] * n
for i in range(q):
    points[l[i] - 1] += 1
for i in points:
    if i <= 0:
        print('No')
    else:
        print('Yes')

Buggy python submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
l = [int(input()) for i in range(q)]

points = [k] * n
for i in range(q):
    points = map(lambda x: x - 1, points)
    points[l[i] - 1] += 2
for i in points:
    if i <= 0:
        print('No')
    else:
        print('Yes')

Fixed submission:
n, k, q = map(int, input().split())
l = [int(input()) for i in range(q)]

points = [k - q] * n
for i in range(q):
    points[l[i] - 1] += 1
for i in points:
    if i <= 0:
        print('No')
    else:
        print('Yes')
Buggy python submission (verdict: Runtime Error):
print(int(input()**3))

Fixed submission:
n = int(input())
print(n ** 3)
Buggy python submission (verdict: Runtime Error):
a, b = input()
a = int(a)
b = int(b)

x = 1
num = 0
while True:
    x += a - 1
    num += 1
    if x >= b:
        break
        
print(num)

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

x = 1
num = 0
while True:
    if b == 1:
        num = 0
        break
    x += (a - 1)
    num += 1
    if x >= b:
        break
        
print(num)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]

l = sorted(a, reverse=True)
m = a.index(a(max))
for i in range(n):
    if i == m:
        print(l[1])
    else:
        print(l[0])

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]

l = sorted(a, reverse=True)
m = a.index(l[0])
for i in range(n):
    if i == m:
        print(l[1])
    else:
        print(l[0])
Buggy python submission (verdict: Runtime Error):
n, d = map(int, input().split())
l = []
for i in range(n):
    l.append(list(map(int, input().split())))
count = 0
import math
for i in range(n):
    for j in range(n):
        sum  = 0
        for i in range(d):
            sum += (l[i][d] -l[i][d]) ** 2
        dis = sqrt(sum)
        if dis % 1 == 0:
            count += 1
print(count)

Fixed submission:
n, d = map(int, input().split())
l = []
for i in range(n):
    l.append(list(map(int, input().split())))
count = 0
import math
for i in range(n):
    for j in range(i + 1, n):
        sum  = 0
        if i != j:
            for k in range(d):
                sum += (l[i][k] -l[j][k]) ** 2
            dis = math.sqrt(sum)
            if dis % 1 == 0:
                count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
k = []
for i in range(m):
    l, r = map(int, input().split())
    k.append(list(range(l, r + 1)))

flag = [0] * n
for i in range(n):
    count = 0
    for j in k:
        if (i + 1) in j:
            count += 1
    if count == m:
        flag[i] = 1

print(sum(flag))

Fixed submission:
n, m = map(int, input().split())
L = []
R = []
for i in range(m):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)
count = min(R) - max(L) + 1
if count <= 0:
    print(0)
else:
    print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
k = []
for i in range(m):
    l, r = map(int, input().split())
    k.append(list(range(l, r + 1)))
c = [0] * n
for i in range(m):
    for j in range(n):
        if (j + 1) in k[i]:
            c[j] += 1
count = 0
for i in c:
    if m == i:
        count += 1
print(count)

Fixed submission:
n, m = map(int, input().split())
L = []
R = []
for i in range(m):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)
count = min(R) - max(L) + 1
if count <= 0:
    print(0)
else:
    print(count)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
l = []
for i in range(m):
    l, r = map(int, input().split())
    l.append(list(range(l, m + 1)))
c = [0] * n
for i in range(m):
    for j in range(n):
        if (j + 1) in l[i]:
            c[j] += 1
counr = 0
for i in c:
    if m == c[i]:
        count += 1
print(count)

Fixed submission:
n, m = map(int, input().split())
L = []
R = []
for i in range(m):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)
count = min(R) - max(L) + 1
if count <= 0:
    print(0)
else:
    print(count)
Buggy python submission (verdict: Runtime Error):
st = list(input())
s = [int(i) for i st]

a1 = [0, 1] * (len(s) // 2)
a2 = [1, 0] * (len(s) // 2)
if len(s) % 2 == 1:
    a1.append(0)
    a2.append(1)

count = 0
l = [0] * 2
for i in range(len(s)):
    if s[i] != a1[i]:
        l[0] += 1
    if s[i] != a2[i]:
        l[1] += 1
print(min(l))

Fixed submission:
st = list(input())
s = [int(i) for i in st]

a1 = [0, 1] * (len(s) // 2)
a2 = [1, 0] * (len(s) // 2)
if len(s) % 2 == 1:
    a1.append(0)
    a2.append(1)

count = 0
l = [0] * 2
for i in range(len(s)):
    if s[i] != a1[i]:
        l[0] += 1
    if s[i] != a2[i]:
        l[1] += 1
print(min(l))

Buggy python submission (verdict: Runtime Error):
s = list(int(input()))

a1 = [0, 1] * (len(s) // 2)
a2 = [1, 0] * (len(s) // 2)
if len(s) % 2 == 1:
    a1.append(0)
    a2.append(1)

count = 0
l = [0] * 2
for i in range(len(s)):
    if s[i] != a1[i]:
        l[0] += 1
    if s[i] != a2[i]:
        l[1] += 1
print(min(l))

Fixed submission:
st = list(input())
s = [int(i) for i in st]

a1 = [0, 1] * (len(s) // 2)
a2 = [1, 0] * (len(s) // 2)
if len(s) % 2 == 1:
    a1.append(0)
    a2.append(1)

count = 0
l = [0] * 2
for i in range(len(s)):
    if s[i] != a1[i]:
        l[0] += 1
    if s[i] != a2[i]:
        l[1] += 1
print(min(l))
Buggy python submission (verdict: Runtime Error):
s = input()
l = list(s)

count = 0
clist = []
n = (len(l))
for i in range(n):
    if l[i] in 'ACGT':
        count += 1
    else:
        clist.append(count)
        count = 0
        
print(max(clist))

Fixed submission:
s = input()
l = list(s)

count = 0
clist = []
n = (len(l))
for i in range(n):
    if l[i] in 'ACGT':
        count += 1
        if i == n - 1:
            clist.append(count)
    else:
        clist.append(count)
        count = 0

print(max(clist))
Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = list(input())
for i in range(q):
    l, r = map(int, input().split())
    t = s[l - 1:r]
    ans = 0
    for j in range(len(t) - 1):
        if t[j] == 'A' and t[j + 1] == 'C':
            ans += 1
    print(ans)

Fixed submission:
n, q = map(int, input().split())
s = list(input())
num = [0] * n
count = 0
for i in range(n - 1):
    if s[i] == 'A' and s[i + 1] == 'C':
        count += 1
    num[i + 1] = count
for i in range(q):
    l, r = map(int, input().split())
    ans = num[r - 1] - num[l - 1]
    print(ans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
l = [0] * m
for i in range(n):
    for j in range(m):
        if j + 1 in a[i][1:]:
            l[i] += 1
count = 0
for i in range(n):
    if l[i] == n:
        count += 1
print(count)

Fixed submission:
n, m = map(int, input().split())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
l = [0] * m
for i in range(n):
    for j in range(m):
        if j + 1 in a[i][1:]:
            l[j] += 1
count = 0
for i in range(m):
    if l[i] == n:
        count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
l = [0] * m
for i in range(n):
    for j in range(m):
        if j + 1 in a[i][1:]:
            l[i] += 1
count = 0
print(l)
for i in range(n):
    if l[i] == n:
        count += 1
print(count)

Fixed submission:
n, m = map(int, input().split())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
l = [0] * m
for i in range(n):
    for j in range(m):
        if j + 1 in a[i][1:]:
            l[j] += 1
count = 0
for i in range(m):
    if l[i] == n:
        count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
l = [0] * n
for i in range(m):
    for j in range(n):
        if i + 1 in a[j][1:]:
            l[i] += 1
count = 0
print(l)
for i in range(n):
    if l[i] == n:
        count += 1
print(count)

Fixed submission:
n, m = map(int, input().split())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
l = [0] * m
for i in range(n):
    for j in range(m):
        if j + 1 in a[i][1:]:
            l[j] += 1
count = 0
for i in range(m):
    if l[i] == n:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]

g = gcd(a[0], a[1])
for i in range(2, n):
    g = gcd(g, a[i])
    
print(g)

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

import math
g = math.gcd(a[0], a[1])
for i in range(2, n):
    g = math.gcd(g, a[i])

print(g)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())
if n == 1:
    print('Hello World')
else:
    print(a + b)


Fixed submission:
n = int(input())
if n == 1:
    print('Hello World')
else:
    a = int(input())
    b = int(input())
    print(a + b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a, b = map(int, input().split())
if n == 1:
    print('Hello World')
else:
    print(a + b)

Fixed submission:
n = int(input())
if n == 1:
    print('Hello World')
else:
    a = int(input())
    b = int(input())
    print(a + b)
Buggy python submission (verdict: Runtime Error):
n, t = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
l = []
flag = False
for i in range(n):
    if a[i][2] <= t:
        l.append(a[i][0])
        flag = True
if flag:
    print(min(l))
else:
    print('TLE')

Fixed submission:
n, t = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
l = []
flag = False
for i in range(n):
    if a[i][1] <= t:
        l.append(a[i][0])
        flag = True
if flag:
    print(min(l))
else:
    print('TLE')
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
t = list(input())
n = len(s)

s_par = [i for i in range(n + 1)]
t_par = [i for i in range(n + 1)]

def operation(x, par):
    for i in range(n):
        for j in range(i):
            if x[i] == x[j]:
                par[i] = par[j]
    return par

if operation(s, s_par) == operation(t, t_par):
    print('Yes')
else:
    print('No')

Fixed submission:
s = list(input())
t = list(input())
n = len(s)

s_par = [i for i in range(n + 1)]
t_par = [i for i in range(n + 1)]

for i in range(n):
    for j in range(i):
        if s[i] == s[j]:
            s_par[i] = s_par[j]
            break
            
for i in range(n):
    for j in range(i):
        if t[i] == t[j]:
            t_par[i] = t_par[j]
            break
            
if s_par == t_par:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
a = list(map(int, input().split()))

l = sorted(a)
flag = False
for i in range(n):
    x -= l[i]
    if x < 0:
        flag = True
        break
if flag:
    print(i)
elif x = 0:
    print(n)
elif x > 0:
    print(n - 1)

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

l = sorted(a)
flag = False
for i in range(n):
    x -= l[i]
    if x < 0:
        flag = True
        break
if flag:
    print(i)
elif x == 0:
    print(n)
elif x > 0:
    print(n - 1)
Buggy python submission (verdict: Runtime Error):
n=int(input)
flag=True
a=0
l=[]
for i in range(n):
    b=a
    l.append(b)
    a=list(input())
    if i>0:
        if a[0]!=b[-1] or a in l:
            flag=False
if flag:
    print('Yes')
else:
    print('No')

Fixed submission:
n=int(input())
flag=True
a=0
l=[]
for i in range(n):
    b=a
    l.append(b)
    a=list(input())
    if i>0:
        if a[0]!=b[-1] or a in l:
            flag=False
if flag:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
S = list(input())
l = [chr(i) for i in range(65, 65+26)]

flag = True
if S[0] != 'A':
    flag = False
elif S[1] in l:
    flag = False
elif S[len(S)] in l:
    flag = False
elif not 'C' in S[2:len(S) - 2]:
    flag = False
count = 0
for i in range(2, len(S) - 1):
    if flag == False:
        break
    if S[i] in l:
        count += 1
    if count > 1:
        flag = False
if count < 1:
    flag = False
if flag:
    print('AC')
else:
    print('WA')

Fixed submission:
S = list(input())
l = [chr(i) for i in range(65, 65+26)]

flag = True
count = 0
for i in range(len(S)):
    if i == 0:
        if S[i] != 'A':
            flag = False
            break
    if i == 1:
        if S[i] in l:
            flag = False
            break
    if 2 <= i <= len(S) - 2:
        if S[i] == 'C':
            count += 1
        elif S[i] in l:
            flag = False
            break
    if i == len(S) - 1:
        if S[i] in l:
            flag = False
            break
if not count == 1:
    flag = False

if flag:
    print('AC')
else:
    print('WA')