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

Fixed submission:
from queue import Queue

def bfs(point):
    global visit, s
    while point.qsize() > 0:
        hh, ww = point.get()
        h_w_list = [[1, 0], [- 1, 0], [0, 1], [0, - 1]]
        for h_, w_ in h_w_list:
            h_ = h_ + hh
            w_ = w_ + ww
            if (h_ in range(h)) & (w_ in range(w)):
                if s[h_][w_] == ".":
                    if visit[h_][w_] == inf:                    
                        point.put([h_, w_])
                        visit[h_][w_] = visit[hh][ww] + 1
        
    
inf = 10 ** 9    
h, w = map(int, input().split())
s = []
point_num = 0
for _ in range(h):
    k = input()
    point_num += k.count(".")
    s.append(list(k))
visit = [[inf for _ in range(w)] for _ in range(h)]
point = Queue()
point.put([0, 0])
visit[0][0] = 0
bfs(point)
ans = point_num - visit[-1][-1] - 1
if ans < 0:
    ans = -1
print(ans)

Buggy submission (verdict: Runtime Error):
from queue import Queue

def bfs(point):
    global visit, s
    while point.qsize() > 0:
        hh, ww = point.get()
        h_w_list = [[hh + 1, ww], [hh - 1, ww], [hh, ww + 1], [hh, ww - 1]]
        min_num = inf
        for h_, w_ in h_w_list:
            if (h_ in range(h)) & (w_ in range(w)):
                min_num = min(min_num, visit_num[h_][w_])
                if s[h_][w_] == ".":
                    if visit[h_][w_] == inf:                    
                        point.put([h_, w_])
        if visit[hh][ww] == inf:
            visit[hh][ww] = min_num

    
inf = 10 ** 9    
h, w = map(int, input().split())
s = []
point_num = 0
for _ in range(h):
    k = input()
    point_num += k.count(".")
    s.append(list(k))
visit = [[inf for _ in range(w)] for _ in range(h)]
point = Queue()
point.put([0, 0])
visit[0][0] = 0
bfs(point)
ans = point_num - visit[-1][-1] - 1
if ans < 0:
    ans = -1
print(ans)

Buggy submission (verdict: Runtime Error):
from queue import Queue

def bfs(point):
    global visit, s
    while point.qsize() > 0:
        hh, ww = point.get()
        h_w_list = [[hh + 1, ww], [hh - 1, ww], [hh, ww + 1], [hh, ww - 1]]
        min_num = inf
        for h_, w_ in h_w_list:
            if (h_ in range(h)) & (w_ in range(w)):
                min_num = min(min_num, visit_num[h_][w_])
                if s[h_][w_] == ".":
                    if visit[h_][w_] == inf:                    
                        point.put([h_, w_])
        if visit[hh][ww] == inf:
            visit[hh][ww] = calc_min(hh, ww)

    
inf = 10 ** 9    
h, w = map(int, input().split())
s = []
point_num = 0
for _ in range(h):
    k = input()
    point_num += k.count(".")
    s.append(list(k))
visit = [[inf for _ in range(w)] for _ in range(h)]
point = Queue()
point.put([0, 0])
visit[0][0] = 0
bfs(point)
ans = point_num - visit[-1][-1] - 1
if ans < 0:
    ans = -1
print(ans)
Problem p03450 (python)

Fixed submission:
from collections import deque

n, m = map(int, input().split())
graph = [[] for _ in range(n)]
for i in range(m):
    l, r, d = map(int, input().split())
    l -= 1
    r -= 1
    graph[r].append((l, r, -d))
    graph[l].append((r, l, d))

max_int = 10 ** 10
point = [None for _ in range(n)]

for v in range(n):
    Q = deque()
    if point[v] is not None:
        continue
    Q.extend(graph[v])
    while Q:
        next_v, v, d = Q.popleft()
        if point[v] is None:
            point[v] = 0
        if point[next_v] is not None:
            if point[next_v] != point[v] + d:
                print('No')
                exit()
            else:
                continue
        point[next_v] = point[v] + d
        Q.extend(graph[next_v])
print('Yes')

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

n, m = map(int, input().split())
graph = [[] for _ in range(n)]
edge = []
for i in range(m):
    l, r, d = map(int, input().split())
    l -= 1
    r -= 1
    graph[r].append((l, i))
    graph[l].append((r, i))
    edge.append(d)

check_v = [False for _ in range(n)]
check_e = [False for _ in range(n)]
max_int = 10 * 10
point = [max_int for _ in range(n)]

for v in range(n):
    Q = deque()
    Q.append(v)
    while Q:
        v = Q.popleft()
        if not check_v[v]:
            for next_v, e in graph[v]:
                if not check_e[e]:
                    if point[v] == max_int:
                        point[v] = 0
                    if point[next_v] == max_int:
                        point[next_v] = point[v] + edge[e]
                    else:
                        if point[next_v] != point[v] + edge[e]:
                            print('No')
                            exit()
                check_e[e] = True
                if not check_v[next_v]:
                    Q.append(next_v)
            check_v[v] = True
print('Yes')
Problem p03476 (python)

Fixed submission:
def Eratosthenes(n):
    prime_list = [True for _ in range(n + 1)]
    prime_list[0] = False
    prime_list[1] = False
    for j in range(4, n + 1, 2):
        prime_list[j] = False
    prime_list[2] = True
    for i in range(3, int(n ** 0.5) + 1, 2):
        if prime_list[i]:
            for j in range(i * 2, n + 1, i):
                prime_list[j] = False
    return prime_list


def prime_2017(prime_list):
    prime_2017_list = [True for _ in range(len(prime_list))]
    for i in range(len(prime_list)):
        if i <= 2:
            prime_2017_list[i] = False
        elif prime_list[i]:
            if not prime_list[(i + 1) // 2]:
                prime_2017_list[i] = False
        else:
            prime_2017_list[i] = False
    return prime_2017_list

q = int(input())
num_list = []
num_max = 0
for _ in range(q):
    l, r = map(int, input().split())
    num_list.append([l, r])
    num_max = max(r, num_max)
prime_list = Eratosthenes(num_max)
prime_2017_list = prime_2017(prime_list)
prime_num = [0 for _ in range(num_max + 1)]
for i in range(num_max):
    prime_num[i + 1] = prime_num[i] + prime_2017_list[i + 1]

for l, r in num_list:
    print(prime_num[r] - prime_num[l - 1])

Buggy submission (verdict: Runtime Error):
def prime(i):
    if i == 1:
        return False
    if (i > 2) & (i % 2 == 0):
        return False
    for j in range(3, int(i**(0.5)) + 1, 2):
        if i % j == 0:
            return False
    return True



q = int(input())
for _ in range(q):
    ans = 0
    l, r = map(int, input().split())
    while (i <= r):
        if prime(i) & prime(int(i+1)//2):
            ans += 1
            i += 4
        else:
            i += 2
    print(ans)
Problem p03504 (python)

Fixed submission:
N, C = map(int, input().split())
max_size = 10 ** 5
record_list = [[int(i) - 1 for i in input().split()] for _ in range(N)]
ans_list = [0 for _ in range(max_size)]
for c in range(C):
    T = [0 for _ in range(max_size + 1)]
    for s, t, i in record_list:
        if i == c:
            T[s] += 1
            T[t + 1] -= 1
    for i in range(max_size):
        T[i + 1] += T[i]
    for i in range(max_size):
        ans_list[i] += T[i] > 0
print(max(ans_list))

Buggy submission (verdict: Runtime Error):
N, C = map(int, input().split())
record = [[0 for _ in range(10 ** 5)] for _ in range(C)]
for _ in range(N):
    s, t, c = map(int, input().split())
    s -= 1
    c -= 1
    record[c][s] += 1
    record[c][t] -= 1
cum = []
for i in range(C):
    tmp = [record[i][0]]
    for j in range(10 ** 5 - 1):
        tmp.append(tmp[-1] + record[i][j + 1])
    cum.append(tmp)
ans = 0
for i in range(10 ** 5):
    tmp = 0
    for j in range(C):
        tmp += cum[j][i]
    ans = max(tmp, ans)
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1000000000)
N, C = map(int, input().split())
record = [[0 for _ in range(10 ** 5)] for _ in range(C)]
for _ in range(N):
    s, t, c = map(int, input().split())
    s -= 1
    c -= 1
    record[c][s] += 1
    record[c][t] -= 1
cum = []
for i in range(C):
    tmp = [record[i][0]]
    for j in range(10 ** 5 - 1):
        tmp.append(tmp[-1] + record[i][j + 1])
    cum.append(tmp)
ans = 0
for i in range(10 ** 5):
    tmp = 0
    for j in range(C):
        tmp += cum[j][i]
    ans = max(tmp, ans)
print(ans)

Buggy submission (verdict: Runtime Error):
N, C = map(int, input().split())
record = [[0 for _ in range(10 ** 5)] for _ in range(C)]
for _ in range(N):
    s, t, c = map(int, input().split())
    s -= 1
    c -= 1
    record[c][s] += 1
    record[c][t] -= 1
cum = []
for i in range(C):
    tmp = [record[i][0]]
    for j in range(10 ** 5 - 1):
        tmp.append(tmp[-1] + record[i][j + 1])
    cum.append(tmp)
ans = 0
for i in range(10 ** 5):
    tmp = 0
    for j in range(C):
        tmp += cum[j][i]
    ans = max(tmp, ans)
print(ans)
Problem p03543 (python)

Fixed submission:
import collections
n = list(input())
if ((len(collections.Counter(n[:3])) == 1) | (len(collections.Counter(n[1:])) == 1)):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = list(input())
if ((len(collections.Counter(n[:3])) == 1) | (len(collections.Counter(n[1:])) == 1)):
    print("Yes")
else:
    print("No")
Problem p03545 (python)

Fixed submission:
a,b,c,d = list(input())
a,b,c,d = int(a), int(b), int(c), int(d)
mark = {"+":1,"-":-1}
e = 0
for i, i_ in mark.items():
    for j, j_ in mark.items():
        for k, k_ in mark.items():
            if (e==0)&(a + i_ * b + c * j_ + d * k_ == 7):
                ans = str(a)+i+str(b)+j+str(c)+k+str(d)+"=7"
                print(ans)
                e = 1
                break

Buggy submission (verdict: Runtime Error):
a,b,c,d = list(input())
a,b,c,d = int(a), int(b), int(c), int(d)
mark = {"+":1,"-":-1}
e = 0
for i, i_ in mark.items():
    for j, j_ in mark.items():
        for k, k_ in mark.items():
            if (e==0)&(a + i_ * b + c * j_ + d * k_ == 7):
                print(f"{a}{i}{b}{j}{c}{k}{d}=7")
                e = 1
                break
Problem p03569 (python)

Fixed submission:
s = input()
left = 0
right = len(s) - 1
x_left = 0
x_right = 0
if len(s) >= 2:
    while (left <= right):
        if s[left] == s[right]:
            left += 1
            right -= 1
        elif s[left] == "x":
            x_left += 1
            left += 1
        elif s[right] == "x":
            x_right += 1
            right -= 1
        else:
            print(-1)
            exit()
    print(x_left + x_right)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
s = input()
left = 0
right = len(s) - 1
x_left = 0
x_right = 0
if len(s) >= 2:
    while (left <= right):
        if s[left] == s[right]:
            left += 1
            right -= 1
        elif s[left] == "x":
            x_left += 1
            left += 1
        elif s[right] == "x":
            x_right += 1
            right -= 1
        if (right - left == 1) & (s[left] != s[right]):
            if (s[left] != "x") & (s[right] != "x"):
                print(-1)
                exit()
            else:
                print(x_left + x_right + 1)
                exit()
    print(x_left + x_right)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
s = input()
left = 0
right = len(s) - 1
x_left = 0
x_right = 0
if len(s) >= 2:
    while (left <= right):
        if s[left] == s[right]:
            left += 1
            right -= 1
        elif s[left] == "x":
            x_left += 1
            left += 1
        elif s[right] == "x":
            x_right += 1
            right -= 1
        if (right - left == 1) & (s[left] != s[right]):
            if (s[left] != "x") & (s[right] != "x"):
                print(-1)
                exit()
    print(x_left + x_right)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
s = input()
left = 0
right = len(s) - 1
x_left = 0
x_right = 0
if len(s) > 2:
    while (left <= right):
        if s[left] == s[right]:
            left += 1
            right -= 1
        elif s[left] == "x":
            x_left += 1
            left += 1
        elif s[right] == "x":
            x_right += 1
            right -= 1
        if (right - left == 1) & (s[left] != s[right]):
            if (s[left] != "x") & (s[right] != "x"):
                print(-1)
                exit()
    print(x_left + x_right)
else:
    print(0)
Problem p03599 (python)

Fixed submission:
a, b, c, d, e, f = map(int, input().split())
a_list = set([])
b_list = set([])
for i in range((f // a) + 1):
    for j in range((f // b) + 1):
        if 0 < ((a*i) + (b*j)) * 100 <= f:
            a_list.add(((a*i)+(b*j))*100)
for i in range((f // c) + 1):
    for j in range((f // d) + 1):
        if ((c*i) + (d*j)) <= f:
            b_list.add((c*i)+(d*j))
ans = 0
ans_1 = 0
ans_2 = 0
for aa in a_list:
    for bb in b_list:
        if (aa + bb <= f) & ((bb / aa) <= e * 0.01):
            if ans <= (bb / aa) * 100:
                ans = (bb / (aa)) * 100
                ans_1 = aa + bb
                ans_2 = bb
print(str(ans_1) + " " + str(ans_2))

Buggy submission (verdict: Runtime Error):
a, b, c, d, e, f = map(int, input().split())
a_list = set([])
b_list = set([])
for i in range((f // a) + 1):
    for j in range((f // b) + 1):
        if 0 < ((a*i) + (b*j)) * 100 <= f:
            a_list.add(((a*i)+(b*j))*100)
for i in range((f // c) + 1):
    for j in range((f // d) + 1):
        if ((c*i) + (d*j)) <= f:
            b_list.add((c*i)+(d*j))
ans = 0
ans_1 = 0
ans_2 = 0
for aa in a_list:
    for bb in b_list:
        if (aa + bb <= f) & ((bb / (aa + bb) * 100 <= e):
            if ans <= (bb / (aa + bb)) * 100:
                ans = (bb / aa) * 100
                ans_1 = aa + bb
                ans_2 = bb
print(str(ans_1) + " " + str(ans_2))
Problem p03633 (python)

Fixed submission:
def gcd(a,b):
    while b:
        a, b = b, a%b
    return a

def lcm(a,b):
    return a * b // (gcd(a,b))
n = int(input())
a = [1]
for _ in range(n):
    a.append(int(input()))
for i in range(1, n+1):
    a[i] = lcm(a[i-1], a[i])
print(a[-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [1]
for _ in range(n):
    a.append(int(input()))
for i in range(1, n+1):
    a[i] = lcm(a[i-1], a[i])
print(a[-1])
Problem p03699 (python)

Fixed submission:
n = int(input())
s = []
for _ in range(n):
    s.append(int(input()))
sum_s = sum(s)
if sum_s % 10 != 0:
    ans = sum_s
else:
    s_10 = [i for i in s if (i%10 != 0)]
    s_10.sort()
    if len(s_10) > 0:
        ans = sum_s - s_10[0]
    else:
        ans = 0
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
dp = [0] * (2**n)
s = []
for _ in range(n):
    s.append(int(input()))
for i in range(n):
    k = 2 ** i
    for j in range(k):
        dp[k+j] = dp[j] + s[i]
dp = [i if (i%10 != 0) else 0 for i in dp]
print(max(dp))
Problem p03700 (python)

Fixed submission:
def calc(n):
    damage = (b * n)
    d = [max(dd - damage, 0) for dd in h]
    a_num = 0
    for i in range(len(d)):
        a_num += max(0, 1 + (d[i]-1) // (a - b))
    if a_num <= n:
        return True
    return False

n, a, b = map(int, input().split())
h = []
for _ in range(n):
    h.append(int(input()))
ans = 0
h.sort()

left = 0
right = 10000000000

while (right - left) > 1:
    middle = (left + right) // 2
    if calc(middle):
        right = middle
    else:
        left = middle
print(right)

Buggy submission (verdict: Runtime Error):
def calc(n):
    damage = (b * n)
    d = [max(dd - damage, 0) for dd in h]
    a_num = 0
    for i in range(len(d)):
        a_num += max(0, 1 + (d[i]-1) // (a - b))
    if a_num <= n:
        return True
    return False

n, a, b = map(int, input().split())
h = []
for _ in range(n):
    h.append(int(input()))
ans = 0
h.sort()

left = 0
right = (h[-1] + 1) // (b)

while (right - left) > 1:
    middle = (left + right) // 2
    if calc(middle):
        right = middle
    else:
        left = middle
if calc(middle):
    print(middle)
else:
    print(middle + 1)

Buggy submission (verdict: Runtime Error):
def calc(n):
    damage = (b * n)
    d = [max(dd - damage, 0) for dd in h]
    a_num = 0
    for i in range(len(d)):
        a_num += max(0, 1 + (d[i]-1) // (a - b))
    if a_num <= n:
        return True
    return False

n, a, b = map(int, input().split())
h = []
for _ in range(n):
    h.append(int(input()))
ans = 0
h.sort()

left = 0
right = (h[-1] + 1) // (b)

while (right - left) > 1:
    middle = (left + right) // 2
    if calc(middle):
        right = middle
    else:
        left = middle
print(middle)

Buggy submission (verdict: Runtime Error):
def calc(n):
    damage = (b * n)
    d = [max(dd - damage, 0) for dd in h]
    a_num = 0
    for i in range(len(d)):
        a_num += max(0, 1 + (d[i]-1) // (a - b))
    if a_num <= n:
        return True
    return False

n, a, b = map(int, input().split())
h = []
for _ in range(n):
    h.append(int(input()))
ans = 0
h.sort()

left = 1
right = (h[-1] + 1) // (b)

while (right - left) > 1:
    middle = (left + right) // 2
    if calc(middle):
        right = middle
    else:
        left = middle
print(middle)

Buggy submission (verdict: Runtime Error):
import copy
def calc(n):
    d = copy.deepcopy(h)
    d = [dd - (b * n) for dd in d if (dd - (b*n)) > 0]
    a_num = sum([dd // (a - b) if (dd % (a - b) == 0) else (dd // (a - b)) + 1 for dd in d])
    if a_num <= n:
        return True
    return False

n, a, b = map(int, input().split())
h = []
for _ in range(n):
    h.append(int(input()))
ans = 0


left = 1
right = (max(h) + 1) // (b)

while right - left > 1:
    middle = (left + right) // 2
    if calc(middle):
        right = middle
    else:
        left = middle
print(middle)
Problem p03715 (python)

Fixed submission:
h, w = map(int, input().split())
s = h * w
if s % 3 == 0:
    ans = 0
else:
    c = []
    for i in range(1, h):
        sa = i * w
        sb = (h - i) * (w // 2)
        sc = (h - i) * (w - (w // 2))
        min_s = min(sa, min(sb, sc))
        max_s = max(sa, max(sb, sc))
        c.append(max_s - min_s)
        sb = ((h - i) // 2) * w
        sc = s - sa - sb
        min_s = min(sa, min(sb, sc))
        max_s = max(sa, max(sb, sc))
        c.append(max_s - min_s)
    for i in range(1, w):
        sa = i * h
        sb = (w - i) * (h // 2)
        sc = (w - i) * (h - (h // 2))
        min_s = min(sa, min(sb, sc))
        max_s = max(sa, max(sb, sc))
        c.append(max_s - min_s)
        sb = ((w - i) // 2) * h
        sc = s - sa - sb
        min_s = min(sa, min(sb, sc))
        max_s = max(sa, max(sb, sc))
        c.append(max_s - min_s)
    ans = min(c)
print(ans)

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = h * w
if (h == 2) & (w == 2):
    ans = 1
if s % 3 == 0:
    ans = 0
else:
    c = []
    for i in range(1, h-1):
        sa = i * w
        sb = (h - i) * (w // 2)
        sc = (h - i) * (w - (w // 2))
        min_s = min(sa, min(sb, sc))
        max_s = max(sa, max(sb, sc))
        c.append(max_s - min_s)
    for i in range(1, w-1):
        sa = i * h
        sb = (w - i) * (h // 2)
        sc = (w - i) * (h - (h // 2))
        min_s = min(sa, min(sb, sc))
        max_s = max(sa, max(sb, sc))
        c.append(max_s - min_s)
    ans = min(c)
print(ans)

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = h * w
if s % 3 == 0:
    ans = 0
else:
    c = []
    for i in range(1, h-1):
        sa = i * w
        sb = (h - i) * (w // 2)
        sc = (h - i) * (w - (w // 2))
        min_s = min(sa, min(sb, sc))
        max_s = max(sa, max(sb, sc))
        c.append(max_s - min_s)
    for i in range(1, w-1):
        sa = i * h
        sb = (w - i) * (h // 2)
        sc = (w - i) * (h - (h // 2))
        min_s = min(sa, min(sb, sc))
        max_s = max(sa, max(sb, sc))
        c.append(max_s - min_s)
    ans = min(c)
print(ans)
Problem p03734 (python)

Fixed submission:
from itertools import accumulate
n, w = map(int, input().split())
w_0, v_0 = map(int, input().split())
v_list = [[] for _ in range(4)]
v_list[0].append(v_0)
for _ in range(n - 1):
    w_in, v_in = map(int, input().split())
    v_list[w_in - w_0].append(v_in)
v_list = [[0] + list(accumulate(sorted(v, reverse=True))) for v in v_list]
ans = 0
for i in range(len(v_list[0])):
    for j in range(len(v_list[1])):
        for k in range(len(v_list[2])):
            for l in range(len(v_list[3])):
                if ((i) * w_0) + ((j) * (w_0 + 1)) + ((k) * (w_0 + 2)) + (((l) * (w_0 + 3))) <= w:
                    ans = max(ans, v_list[0][i] + v_list[1][j] + v_list[2][k] + v_list[3][l])
                else:
                    break
print(ans)

Buggy submission (verdict: Runtime Error):
n, w = map(int, input().split())
a = []
for _ in range(n):
    w_in, v_in = map(int, input().split())
    a.append([w_in, v_in])

dp = [[0 for _ in range(w + 1)] for _ in range(n + 1)]
for j in range(w + 1):
    for i in range(n):
        w_in, v_in = a[i]
        if j + w_in <= w:
            dp[i + 1][j + w_in] = max(dp[i + 1][j + w_in], dp[i][j] + v_in)
            if i + 2 <= n:
                dp[i + 2][j + w_in] = max(dp[i + 2][j + w_in], dp[i + 1][j + w_in])
        dp[i + 2][j] = max(dp[i + 2][j], dp[i + 1][j])
print(max([max(d) for d in dp]))
Problem p03779 (python)

Fixed submission:
x = int(input())
for i in range(x+10):
    if (i*(i+1) / 2 < x) & (((i+1)*(i+2)) / 2 >= x):
        break
ans = i+1
print(ans)

Buggy submission (verdict: Runtime Error):
import bisect
x = int(input())
num_list = list(range(x))
a = [0]*x
a[0] = num_list[0]
for i in range(1,x):
    a[i] = a[i-1] + num_list[i]
print(bisect.bisect_left(a, x))

Buggy submission (verdict: Runtime Error):
import bisect
x = int(input())
num_list = list(range(x))
a = [0]*x
a[0] = num_list[0]
for i in range(1,x):
    a[i] = a[i-1] + num_list[i]
print(bisect.bisect_left(a, x))

Buggy submission (verdict: Runtime Error):
import bisect
x = int(input())
num_list = list(range(x))
a = [0]*x
a[0] = num_list[0]
for i in range(1,x):
    a[i] = a[i-1] + num_list[i]
print(bisect.bisect_left(a, x))
Problem p03818 (python)

Fixed submission:
from collections import Counter
n = int(input())
a = [int(i) for i in input().split()]
k = Counter(a)
b = list(k.values())
b = [1 if bb % 2 == 1 else 2 for bb in b]
over_2 = [bb for bb in b if bb >= 2]
if len(over_2) == 0:
    print(len(b))
elif len(over_2) % 2 == 0:
    print(len(b))
else:
    print(len(b) - 1)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
a = [int(i) for i in input().split()]
k = Counter(a)
b = list(k.values())
over_2 = [bb for bb in b if bb >= 2]
if sum(over_2) % 2 == 1:
    print(len(b))
else:
    if len(over_2 == 0):
        print(len(b))
    else:
        print(len(b) - 1)
Problem p03909 (python)

Fixed submission:
a, b = map(int, input().split())
A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ""
for i in range(a):
  t = list(input().split())
  if 'snuke' in t:
    ans += A[t.index("snuke")]
    ans += str(i + 1)
print(ans)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
A = 'ABCDEFGHIJKLMN'
ans = ""
for i in range(a):
  t = list(input().split())
  if 'snuke' in t:
    ans += A[t.index("snuke")]
    ans += str(i + 1)
print(ans)
Problem p03957 (python)

Fixed submission:
s = input()
t = s.find("C")
if s[t:].find("F") > 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
t = s.find("C")
if s[t:].find("F") > 0:
    print("Yes")
else:
    print("No")