Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
def answer(x, i, j):
    lcm = (i * j) // math.gcd(i, j)
    xi = x // i
    xj = x // j
    xlcm = x // lcm
    return x - xi - xj + xlcm
a, b, c, d = map(int, input().split())
ans = answer(b, c, d) - answer(a-1, c, d)
print(ans)

Fixed submission:
import fractions
def answer(x, i, j):
    lcm = (i * j) // fractions.gcd(i, j)
    xi = x // i
    xj = x // j
    xlcm = x // lcm
    return x - xi - xj + xlcm
a, b, c, d = map(int, input().split())
ans = answer(b, c, d) - answer(a-1, c, d)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math

a, b, c, d = map(int, input().split())
def answer(x, i, j):
    lcm = (i * j) // math.gcd(i, j)
    xi = x // i
    xj = x // j
    xlcm = x // lcm
    return x - xi - xj + xlcm
ans = answer(b, c, d) - answer(a-1, c, d)
print(ans)

Fixed submission:
import fractions
def answer(x, i, j):
    lcm = (i * j) // fractions.gcd(i, j)
    xi = x // i
    xj = x // j
    xlcm = x // lcm
    return x - xi - xj + xlcm
a, b, c, d = map(int, input().split())
ans = answer(b, c, d) - answer(a-1, c, d)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math

a, b, c, d = map(int, input().split())
def func(x, i, j):
    lcm = (i * j) // math.gcd(i, j)
    xi = x // i
    xj = x // j
    xlcm = x // lcm
    return x - xi - xj + xlcm
print(func(b, c, d) - func(a-1, c, d))

Fixed submission:
import fractions
def answer(x, i, j):
    lcm = (i * j) // fractions.gcd(i, j)
    xi = x // i
    xj = x // j
    xlcm = x // lcm
    return x - xi - xj + xlcm
a, b, c, d = map(int, input().split())
ans = answer(b, c, d) - answer(a-1, c, d)
print(ans)
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))
dis = 0
ans = 0
while (dis <= x):
    dis += l[ans]
    ans += 1
print(ans)

Fixed submission:
n, x = map(int, input().split())
l = list(map(int, input().split()))
dis = 0
ans = 0
if sum(l) <= x:
    print(len(l) + 1)
else:
    while (dis <= x):
        dis += l[ans]
        ans += 1
    print(ans)
Buggy python submission (verdict: Runtime Error):
import copy
import fractions

n = int(input())
l = list(map(int, input().split()))
sum = 0
if len(l) == 2:
    print(max(l[0], l[1]))
    exit()
else:
    for i in range(n):
        ll = copy.deepcopy(l)
        ll.pop(i)
        ans = ll[0]
        for j in range(1, len(ll)):
            ans = fractions.gcd(ans, ll[j])
            if sum < ans:
                sum = ans
print(sum)

Fixed submission:
a, b, t = map(int, input().split())
print(t // a * b)
Buggy python submission (verdict: Runtime Error):
s = input()
max_re = 0
for i in range(len(s)):
    tar_s = s[i:]
    tar_s = re.search(r'(A|T|C|G)*', tar_s).group()
    max_re = max(max_re, len(tar_s))
print(max_re)

Fixed submission:
import re
s = input()
max_re = 0
for i in range(len(s)):
    tar_s = s[i:]
    tar_s = re.search(r'(A|T|C|G)*', tar_s).group()
    max_re = max(max_re, len(tar_s))
print(max_re)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
s = input()
for _ in range(m):
    a, b = map(int, input().split())
    print(s.count("AC", a-1, b))

Fixed submission:
n, m = map(int, input().split())
s = input()
t = [0] * (n+1)
for i in range(n):
    if s[i:i + 2] == "AC":
        t[i + 1] = t[i] + 1
    else:
        t[i + 1] = t[i]
for i in range(m):
    a, b = map(int, input().split())
    print(t[b-1] - t[a-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
s = input()
l = [list(map(int, input().split())) for _ in range(m)]
for i in range(m):
    print(s.count("AC", l[i][0]-1, l[i][1]))

Fixed submission:
n, m = map(int, input().split())
s = input()
t = [0] * (n+1)
for i in range(n):
    if s[i:i + 2] == "AC":
        t[i + 1] = t[i] + 1
    else:
        t[i + 1] = t[i]
for i in range(m):
    a, b = map(int, input().split())
    print(t[b-1] - t[a-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
s = input()
l = [list(map(int, input().split())) for _ in range(m)]
for i in range(m):
    print(s[l[i][0]-1:l[i][1]].count("AC"))

Fixed submission:
n, m = map(int, input().split())
s = input()
t = [0] * (n+1)
for i in range(n):
    if s[i:i + 2] == "AC":
        t[i + 1] = t[i] + 1
    else:
        t[i + 1] = t[i]
for i in range(m):
    a, b = map(int, input().split())
    print(t[b-1] - t[a-1])
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(n)]
num = []
sum = 0
for i in range(n):
    for _ in range(l[i][1]):
        num.append(l[i][0])
num = sorted(num)
for i in range(m):
    sum += num[i]
print(sum)

Fixed submission:
n, m = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(n)]
l.sort(key=lambda x: x[0])
num = 0
ansum = 0
for i in range(n):
    if num + l[i][1] < m:
        ansum += l[i][0] * l[i][1]
        num += l[i][1]
    else:
        ansum += l[i][0] * (m - num)
        break
print(ansum)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(n)]
num = []
for i in range(n):
    for _ in range(l[i][1]):
        num.append(l[i][0])
num = sorted(num)
print(sum(num[:m]))

Fixed submission:
n, m = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(n)]
l.sort(key=lambda x: x[0])
num = 0
ansum = 0
for i in range(n):
    if num + l[i][1] < m:
        ansum += l[i][0] * l[i][1]
        num += l[i][1]
    else:
        ansum += l[i][0] * (m - num)
        break
print(ansum)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(n)]
num = []
for i in range(n):
    for _ in range(l[i][1]):
        num.append(l[i][0])
num = sorted(num)
print(sum(num[:m]))

Fixed submission:
n, m = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(n)]
l.sort(key=lambda x: x[0])
num = 0
ansum = 0
for i in range(n):
    if num + l[i][1] < m:
        ansum += l[i][0] * l[i][1]
        num += l[i][1]
    else:
        ansum += l[i][0] * (m - num)
        break
print(ansum)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
change_s = "" + s
check = True
while check:
    change_s = change_s.replace("01", "")
    change_s = change_s.replace("10", "")
    check = "01" in change_s or "10" in change_s
print(len(s) - len(change_s))

Fixed submission:
s = input()
count_0 = s.count("0")
count_1 = s.count("1")
print(min(count_0, count_1) * 2)
Buggy python submission (verdict: Time Limit Exceeded):
N, W = map(int, input().split())
w = [0] * N
v = [0] * N
for i in range(N):
    w[i], v[i] = map(int, input().split())
dp = [[0] * (W + 1) for _ in range(N + 1)]
for i in range(N):
    for j in range(W + 1):
        if j - w[i] >= 0:
            dp[i + 1][j] = max(dp[i + 1][j], dp[i][j - w[i]] + v[i])
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
print(dp[N][W])

Fixed submission:
N, W = map(int, input().split())
w = [0] * N
v = [0] * N
for i in range(N):
    w[i], v[i] = map(int, input().split())
dp = [[0] * (W + 1) for _ in range(N + 1)]
for i in range(N):
    for j in range(W + 1):
        if j - w[i] >= 0:
            dp[i + 1][j] = max(dp[i + 1][j], dp[i][j - w[i]] + v[i])
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
print(dp[N][W])
Buggy python submission (verdict: Runtime Error):
n = int(input())
    l = [int(input()) for i in range(n)]
    l = sorted(l)
    print(sum(l) - l[-1]//2)

Fixed submission:
n = int(input())
l = [int(input()) for i in range(n)]
l = sorted(l)
print(sum(l) - l[-1]//2)
Buggy python submission (verdict: Runtime Error):
def sft(n, num, add):
    int_sft = int(num+add)
    if int_sft > n:
        return True
    else:
        l.append(int_sft)
        sft(n, num+add, "3")
        sft(n, num+add, "5")
        sft(n, num+add, "7")

n = int(input())
sft(n, "", "3")
sft(n, "", "5")
sft(n, "", "7")
le = []
for i in range(len(l)):
    c3 = str(l[i]).count("3")
    c5 = str(l[i]).count("5")
    c7 = str(l[i]).count("7")
    if c3 > 0 and c5 > 0 and c7 > 0:
        le.append(l[i])
print(len(list(set(le))))

Fixed submission:
n = int(input())
if n == 7 or n == 5 or n == 3:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n = int(input())
sft(n, "", "3")
sft(n, "", "5")
sft(n, "", "7")
le = []
for i in range(len(l)):
    c3 = str(l[i]).count("3")
    c5 = str(l[i]).count("5")
    c7 = str(l[i]).count("7")
    if c3 > 0 and c5 > 0 and c7 > 0:
        le.append(l[i])
print(len(list(set(le))))

Fixed submission:
def sft(n, num, add):
    int_sft = int(num+add)
    if int_sft > n:
        return True
    else:
        l.append(int_sft)
        sft(n, num+add, "3")
        sft(n, num+add, "5")
        sft(n, num+add, "7")

l=[]
n = int(input())
sft(n, "", "3")
sft(n, "", "5")
sft(n, "", "7")
le = []
for i in range(len(l)):
    c3 = str(l[i]).count("3")
    c5 = str(l[i]).count("5")
    c7 = str(l[i]).count("7")
    if c3 > 0 and c5 > 0 and c7 > 0:
        le.append(l[i])
print(len(list(set(le))))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
a = []
b = []
ca = []
cb = []
for i in range(n // 2):
    a.append(l[i * 2])
    b.append(l[i * 2 + 1])
while (len(a) > 0):
    ca.append([a[0], a.count(a[0])])
    a = [s for s in a if not(s == a[0])]
while (len(b) > 0):
    cb.append([b[0], b.count(b[0])])
    b = [s for s in b if not (s == b[0])]
ca.sort(key=lambda x: x[1], reverse=True)
cb.sort(key=lambda x: x[1], reverse=True)
ca_max = ca[0]
cb_max = cb[0]
ca_max_num = ca[0][1]
cb_max_num = cb[0][1]
if ca_max[0] == cb_max[0]:
    if ca_max[1] > cb_max[1]:
        if len(cb) > 1:
            cb_max_num = cb[1][1]
        else:
            cb_max_num = 0
    else:
        if len(ca) > 1:
            ca_max_num = ca[1][1]
        else:
            ca_max_num = 0
print((n // 2) * 2 - ca_max_num - cb_max_num)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
a = {}
b = {}
for i in range(n // 2):
    key_a = l[i * 2]
    key_b = l[i * 2 + 1]
    if key_a in a:
        a[key_a] = a[key_a] + 1
    else:
        a[l[i * 2]] = 1
    if key_b in b:
        b[key_b] = b[key_b] + 1
    else:
        b[key_b] = 1
a = sorted(a.items(), key=lambda x: x[1], reverse=True)
b = sorted(b.items(), key=lambda x: x[1], reverse=True)
# a = list(a.items())
# b = list(b.items())
# print(a)
# print(b)
ca_max = a[0][0]
cb_max = b[0][0]
ca_max_num = a[0][1]
cb_max_num = b[0][1]
same_num = ca_max_num + cb_max_num
if ca_max == cb_max:
    if len(a) > 1:
        next_ca_max = a[1][1]
    else:
        next_ca_max = 0
    if len(b) > 1:
        next_cb_max = b[1][1]
    else:
        next_cb_max = 0
    same_num = max(ca_max_num + next_cb_max, cb_max_num + next_ca_max)
print(n - same_num)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
l = list(map(int, input().split()))
ans = 9999999999999
for i in range(len(l) - k + 1):
    tl = l[i:i + k]
    min_l = min(0, tl[0])
    max_l = max(0, tl[-1])
    min_abs = min(abs(min_l), abs(max_l))
    max_abs = max(abs(min_l), abs(max_l))
    ans = min(ans, min_abs * 2 + max_abs)
print(ans)

Fixed submission:
n, k = map(int, input().split())
l = list(map(int, input().split()))
ans = 9999999999999
for i in range(len(l) - k + 1):
    min_l = min(0, l[i])
    max_l = max(0, l[i+k-1])
    min_abs = min(abs(min_l), abs(max_l))
    max_abs = max(abs(min_l), abs(max_l))
    ans = min(ans, min_abs * 2 + max_abs)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
l = list(map(int, input().split()))
ans = 9999999999999
for i in range(len(l) - k + 1):
    tl = l[i:i + k]
    min_l = min(0, min(tl))
    max_l = max(0, max(tl))
    min_abs = min(abs(min_l), abs(max_l))
    max_abs = max(abs(min_l), abs(max_l))
    ans = min(ans, min_abs * 2 + max_abs)
print(ans)

Fixed submission:
n, k = map(int, input().split())
l = list(map(int, input().split()))
ans = 9999999999999
for i in range(len(l) - k + 1):
    min_l = min(0, l[i])
    max_l = max(0, l[i+k-1])
    min_abs = min(abs(min_l), abs(max_l))
    max_abs = max(abs(min_l), abs(max_l))
    ans = min(ans, min_abs * 2 + max_abs)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
min = 99999999999999
if a % 10 == 0:
    print(10)
else:
    for i in range(1, a):
        c = 0
        for j in range(i, a):
            if i + j == a:
                x = i
                y = j
                while (x > 0):
                    c += x % 10
                    x = x // 10
                while (y > 0):
                    c += y % 10
                    y = y // 10
                if min > c:
                    min = c
    print(min)

Fixed submission:
a = int(input())
if a % 10 == 0:
    print(10)
else:
    c = 0
    while (a > 0):
        c += a % 10
        a = a//10
    print(c)
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in reversed(range(n + 1)):
    if math.sqrt(i).is_integer():
        print(i)
        break

Fixed submission:
n = int(input())
l = []
if n == 1:
    print(1)
else:
    for i in range(1, n + 1):
        for j in range(2, n + 1):
            if i ** j > n:
                break
            l.append(i ** j)
    l = list(set(l))
    l = sorted(l)
    ans = 0
    for i in range(len(l)):
        if l[i] > n:
            break
        ans = l[i]
    print(ans)
Buggy python submission (verdict: Runtime Error):
import colections
H, W = map(int, input().split())
l = [input() for _ in range(H)]
check = [([0] * (W)) for _ in range(H)]
white = 0
for i in range(H):
    white += l[i].count(".")
q = collections.deque()
check[0][0] = 1
q.append([0, 0])
g = False
while q:
    h, w = q.popleft()
    for i, j in ([0, 1], [0, -1], [1, 0], [-1, 0]):
        new_h = h + i
        new_w = w + j
        if new_w < 0 or new_h < 0 or new_w > W-1 or new_h > H-1 or l[new_h][new_w] == "#":
            continue
        elif check[new_h][new_w] == 0:
            check[new_h][new_w] = check[h][w] + 1
            q.append([new_h, new_w])
print(white - check[H-1][W-1] if check[H-1][W-1] != 0 else -1)

Fixed submission:
import collections
H, W = map(int, input().split())
l = [input() for _ in range(H)]
check = [([0] * (W)) for _ in range(H)]
white = 0
for i in range(H):
    white += l[i].count(".")
q = collections.deque()
check[0][0] = 1
q.append([0, 0])
g = False
while q:
    h, w = q.popleft()
    for i, j in ([0, 1], [0, -1], [1, 0], [-1, 0]):
        new_h = h + i
        new_w = w + j
        if new_w < 0 or new_h < 0 or new_w > W-1 or new_h > H-1 or l[new_h][new_w] == "#":
            continue
        elif check[new_h][new_w] == 0:
            check[new_h][new_w] = check[h][w] + 1
            q.append([new_h, new_w])
print(white - check[H-1][W-1] if check[H-1][W-1] != 0 else -1)

Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
l = [input() for _ in range(H)]
check = [([0] * (W)) for _ in range(H)]
white = 0
for i in range(H):
    white += l[i].count(".")
q = collections.deque()
check[0][0] = 1
q.append([0, 0])
g = False
while q:
    h, w = q.popleft()
    for i, j in ([0, 1], [0, -1], [1, 0], [-1, 0]):
        new_h = h + i
        new_w = w + j
        if new_w < 0 or new_h < 0 or new_w > W-1 or new_h > H-1 or l[new_h][new_w] == "#":
            continue
        elif check[new_h][new_w] == 0:
            check[new_h][new_w] = check[h][w] + 1
            q.append([new_h, new_w])
print(white - check[H-1][W-1] if check[H-1][W-1] != -1 else -1)

Fixed submission:
import collections
H, W = map(int, input().split())
l = [input() for _ in range(H)]
check = [([0] * (W)) for _ in range(H)]
white = 0
for i in range(H):
    white += l[i].count(".")
q = collections.deque()
check[0][0] = 1
q.append([0, 0])
g = False
while q:
    h, w = q.popleft()
    for i, j in ([0, 1], [0, -1], [1, 0], [-1, 0]):
        new_h = h + i
        new_w = w + j
        if new_w < 0 or new_h < 0 or new_w > W-1 or new_h > H-1 or l[new_h][new_w] == "#":
            continue
        elif check[new_h][new_w] == 0:
            check[new_h][new_w] = check[h][w] + 1
            q.append([new_h, new_w])
print(white - check[H-1][W-1] if check[H-1][W-1] != 0 else -1)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
l = list(map(int, input().split()))
S = collections.Counter(l)
S = sorted(S.values())
print(sum(S[:len(S)-k]))

Fixed submission:
import collections
n, k = map(int, input().split())
l = list(map(int, input().split()))
S = collections.Counter(l)
S = sorted(S.values())
print(sum(S[:len(S)-k]))

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
l = list(map(int, input().split()))
set_l = list(set(l))
set_l_len = len(set_l)
count = {}
for i in range(set_l_len):
    count[str(set_l[i])] = l.count(set_l[i])
count_sorted = sorted(count.items(), key=lambda x: x[1])
sum = 0
for i in range(max(0, set_l_len - k)):
    sum += count_sorted[i][1]
print(sum)

Fixed submission:
import collections
n, k = map(int, input().split())
l = list(map(int, input().split()))
S = collections.Counter(l)
S = sorted(S.values())
print(sum(S[:len(S)-k]))
Buggy python submission (verdict: Runtime Error):
import math
s = int(input())
for i in range(s):
    if math.sqrt(s - i).is_integer():
        print(s - i)
        break

Fixed submission:
s = input()
l = input()
if s == l[::-1]:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
s = int(input())
for i in range(s):
    if math.sqrt(s - i).is_integer():
        print(s - i)
        break

Fixed submission:
import math
s = int(input())
for i in range(s):
    if math.sqrt(s - i).is_integer():
        print(s - i)
        break
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()))
a.sort()
b.sort()
c.sort()
ans = 0
for i in range(n):
    x = bisect.bisect_left(a, b[i])
    y = bisect.bisect_right(c, b[i])
    ans += x * (n - y)
print(ans)

Fixed submission:
import bisect
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()
ans = 0
for i in range(n):
    x = bisect.bisect_left(a, b[i])
    y = bisect.bisect_right(c, b[i])
    ans += x * (n - y)
print(ans)
Buggy python submission (verdict: Runtime Error):
def count_mine(m, i, j):
    count = 0
    for k in range(i - 1, i + 2):
        for l in range(j - 1, j + 2):
            if m[k][l] == "#":
                count += 1
    return count

H, W = map(int, input().split())
l = [list(map(str, input().split())) for i in range(H)]
m = []
m.append("*" * (W + 2))
for i in range(len(l)):
    add_colum = "*" + ''.join(l[i]) + "*"
    m.append(add_colum)
m.append("*" * (W + 2))
answer = []
for i in range(1, H + 1):
    answer_column = ""
    for j in range(1, W + 1):
        if m[i][j] == ".":
            answer_column += str(count_mine(m, i, j))
        else:
            answer_column += "#"
    answer.append(answer_column)
for i in range(H):
    print(answer[i])

Fixed submission:
a = list(map(int, input().split()))
for i in range(len(a)):
    if a.count(a[i]) == 1:
        print(a[i])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(input()) for _ in range(n)]
ans = [x for x in set(l) if l.count(x) % 2 == 1]
print(len(ans))

Fixed submission:
n = int(input())
l = {}
ans = 0
for _ in range(n):
    a = int(input())
    if a in l:
        l[a] += 1
    else:
        l[a] = 1
for v in l.values():
    if v % 2 == 1:
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(input()) for _ in range(n)]
ans = []
for i in range(n):
    if l[i] in ans:
        ans.remove(l[i])
    else:
        ans.append(l[i])
print(len(ans))

Fixed submission:
n = int(input())
l = {}
ans = 0
for _ in range(n):
    a = int(input())
    if a in l:
        l[a] += 1
    else:
        l[a] = 1
for v in l.values():
    if v % 2 == 1:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
if abs(a - b) >= 2:
    print(0)
else:
    x = math.factorial(a)
    y = math.factorial(b)
    ans = x * y
    if a == b:
        print(ans * 2 % (10 ** 9 + 7))
    else:
        print(ans % (10 ** 9 + 7))

Fixed submission:
x, a, b = map(int, input().split())
if b - a <= 0:
    print("delicious")
elif b - a <= x:
    print("safe")
else:
    print("dangerous")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if abs(a - b) >= 2:
    print(0)
else:
    x = math.factorial(a)
    y = math.factorial(b)
    ans = x * y
    if a == b:
        print(ans * 2 % (10 ** 9 + 7))
    else:
        print(ans % (10 ** 9 + 7))

Fixed submission:
import math
a, b = map(int, input().split())
if abs(a - b) >= 2:
    print(0)
else:
    x = math.factorial(a)
    y = math.factorial(b)
    ans = x * y
    if a == b:
        print(ans * 2 % (10 ** 9 + 7))
    else:
        print(ans % (10 ** 9 + 7))
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
l = []
for i in range(1, int(math.sqrt(n)//1)):
    if n % i == 0:
        l.append(int(n / i))
print(len(str(l[-1])))

Fixed submission:
import math
n = int(input())
l = []
for i in range(1, int(math.sqrt(n)//1)+1):
    if n % i == 0:
        l.append(int(n / i))
print(len(str(l[-1])))

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = []
for i in range(1, int(math.sqrt(n)//1)):
    if n % i == 0:
        l.append(int(n / i))
print(len(str(l[-1])))

Fixed submission:
import math
n = int(input())
l = []
for i in range(1, int(math.sqrt(n)//1)+1):
    if n % i == 0:
        l.append(int(n / i))
print(len(str(l[-1])))
Buggy python submission (verdict: Time Limit Exceeded):
n, c, k = map(int, input().split())
l = sorted([int(input()) for i in range(n)])
count = 0
while len(l) > 0:
    check = l[0] + k
    pas = 0
    for i in range(len(l)):
        if (l[i] <= check) and (pas < c):
            pas += 1
        else:
            break
    l = l[pas:]
    count += 1
print(count)

Fixed submission:
n, c, k = map(int, input().split())
l = sorted([int(input()) for i in range(n)])
count = 1
pas = 0
now = l[0]
for i in range(len(l)):
    check = now + k
    if pas < c and l[i] <= check:
        pas += 1
    else:
        now = l[i]
        pas = 1
        count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n, c, k = map(int, input().split())
l = sorted([int(input()) for i in range(n)])
count = 0
while len(l) > 0:
    check = l[0] + k
    pas = 0
    for i in range(len(l)):
        if (l[i] <= check) and (pas < c):
            pas += 1
    l = l[pas:]
    count += 1
print(count)

Fixed submission:
n, c, k = map(int, input().split())
l = sorted([int(input()) for i in range(n)])
count = 1
pas = 0
now = l[0]
for i in range(len(l)):
    check = now + k
    if pas < c and l[i] <= check:
        pas += 1
    else:
        now = l[i]
        pas = 1
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
import itertools
n, m = map(int, input().split())
l = [list(map(int, input().split())) for i in range(m)]
r = [[] for i in range(n + 1)]
ans = 0
for i in range(m):
    r[l[i][0]].append(l[i][1])
    r[l[i][1]].append(l[i][0])
p = []
for i in range(n):
    p.append(i + 1)
p = list(itertools.permutations(p))
for i in range(len(p)):
    check = True
    t = list(p[i])
    if t[0] != 1:
        check = False
    for j in range(len(t)-1):
        if not t[j + 1] in r[t[j]]:
            check = False
    if check:
        ans += 1
print(ans)

Fixed submission:
a,b = map(int,input().split())
if a == 1:
  a += 20
if b == 1:
  b += 20
if a == b:
  print('Draw')
elif a > b:
  print('Alice')
else:
  print('Bob')