Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#AtCorder Begginer Contest 049 C Daydream

s = input()
s = s[::-1]

dream = "dream"[::-1]
dreamer = "dreamer"[::-1]
erase = "erase"[::-1]
eraser = "eraser"[::-1]

while len(s) > 0:
    if s.startswith(dreamer):
        s = s.replace(dreamer,"",1)
    elif s.startswith(dream):
        s = s.replace(dream,"",1)

    if s.startswith(eraser):
        s = s.replace(eraser,"",1)
    elif s.startswith(erase):
        s = s.replace(erase,"",1)

if len(s) == 0:
    print("YES")
else:
    print("NO")


Fixed submission:
#AtCorder Begginer Contest 049 C Daydream

s = input()
s = s[::-1]

dream = "dream"[::-1]
dreamer = "dreamer"[::-1]
erase = "erase"[::-1]
eraser = "eraser"[::-1]

for i in range(len(s)):
    if s.startswith(dreamer):
        s = s.replace(dreamer,"",1)
    elif s.startswith(dream):
        s = s.replace(dream,"",1)

    if s.startswith(eraser):
        s = s.replace(eraser,"",1)
    elif s.startswith(erase):
        s = s.replace(erase,"",1)

if len(s) == 0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
W, H, N = map(int,input().split())
#白い領域の端
l = 0
r = W
u = H
d = 0
for i in range(N):
    x, y, a = map(int,input().split())
    if a == 1:
        l = max(x,l)
    elif a == 2:
        r = min(x,r)
    elif a == 3:
        d = max(y,d)
    else:
        u = min(y,u)
print(max((r-l),0)*max((u-d),0)

Fixed submission:
W, H, N = map(int,input().split())
#白い領域の端
l = 0
r = W
u = H
d = 0
for i in range(N):
    x, y, a = map(int,input().split())
    if a == 1:
        l = max(x,l)
    elif a == 2:
        r = min(x,r)
    elif a == 3:
        d = max(y,d)
    else:
        u = min(y,u)
print(max((r-l),0)*max((u-d),0))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import os

N = int(input())
T = [0 for _ in range(N)]
A = [0 for _ in range(N)]
for i in range(N):
    t,a = list(map(int,input().split()))
    T[i] = t
    A[i] = a

points = T[0] + A[0]
for i in range(1,N):
    t, a = T[i], A[i]
    t0, a0 = T[i-1], A[i-1]
    while T[i] + A[i] < points or T[i] < t0 or A[i] < a0:
        T[i] += t
        A[i] += a
    points = T[i] + A[i]
print(points)


Fixed submission:
import sys
import os
import math

N = int(input())
T = [0 for _ in range(N)]
A = [0 for _ in range(N)]
for i in range(N):
    t,a = list(map(int,input().split()))
    T[i] = t
    A[i] = a

for i in range(1,N):
    times = max( ( (T[i-1]+T[i]-1) // T[i] ) ,( (A[i-1]+A[i]-1) // A[i] ) )
    T[i] = T[i]*times
    A[i] = A[i]*times
print(T[N-1]+A[N-1])
Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
C = input()
A = list(A)
A.append("end")
B = list(B)
B.append("end")
C = list(C)
C.append("end")
i = 1
j = 0
k = 0
cur = A[0]
while i < len(A) and j < len(B) and k < len(C) :
    if cur == "a":
        cur = A[i]
        if cur == "end":
            print("A")
            sys.exit()
        i += 1
    elif cur == "b":
        cur = B[j]
        if cur == "end":
            print("B")
            sys.exit()
        j += 1
    elif cur == "c":
        cur = C[k]
        if cur == "end":
            print("C")
            sys.exit()
        k += 1

Fixed submission:
import sys
A = input()
B = input()
C = input()
A = list(A)
A.append("end")
B = list(B)
B.append("end")
C = list(C)
C.append("end")
i = 1
j = 0
k = 0
cur = A[0]
while i < len(A) and j < len(B) and k < len(C) :
    if cur == "a":
        cur = A[i]
        if cur == "end":
            print("A")
            sys.exit()
        i += 1
    elif cur == "b":
        cur = B[j]
        if cur == "end":
            print("B")
            sys.exit()
        j += 1
    elif cur == "c":
        cur = C[k]
        if cur == "end":
            print("C")
            sys.exit()
        k += 1
Buggy python submission (verdict: Time Limit Exceeded):
A, B, C = [int(v) for v in input().strip().split(" ")]
K = int(input().strip())

while K > 0:
    if B <= A:
        B *= 2
        K -= 1
    elif C <= B:
        C *= 2
        K -= 1

if C > B > A:
    print("Yes")
else:
    print("No")

Fixed submission:
A, B, C = [int(v) for v in input().strip().split(" ")]
K = int(input().strip())

while K > 0:
    if B <= A:
        B *= 2
        K -= 1
    elif C <= B:
        C *= 2
        K -= 1
    else:
        break

if C > B > A:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N, M, K = [int(v) for v in input().strip().split(" ")]
A = [int(v) for v in input().strip().split(" ")]
B = [int(v) for v in input().strip().split(" ")]

A = [0] + A
B = [0] + B

class Solution():
    def __init__(self):
        self.max_num = 0

    def search(self, now_sum, A_index, B_index, add_axis):
        if add_axis == "A":
            A_index += 1
            if A_index < len(A):
                now_sum += A[A_index]
            else:
                return
        else:
            B_index += 1
            if B_index < len(B):
                now_sum += B[B_index]
            else:
                return

        # print(A_index, B_index, now_sum)

        if A_index + B_index > self.max_num and now_sum <= K:
            self.max_num = A_index + B_index

        if now_sum < K:
            self.search(now_sum, A_index, B_index, "A")
            self.search(now_sum, A_index, B_index, "B")
        else:
            return

    def search_main(self):
        self.search(0, A_index=0, B_index=0, add_axis="A")
        self.search(0, A_index=0, B_index=0, add_axis="B")
        print(self.max_num)

s = Solution()
s.search_main()


Fixed submission:
N, M, K = [int(v) for v in input().strip().split(" ")]
A = [int(v) for v in input().strip().split(" ")]
B = [int(v) for v in input().strip().split(" ")]

a, b = [0], [0]
max_sum = 0

for i in range(len(A)):
    a.append(a[i] + A[i])

for j in range(len(B)):
    b.append(b[j] + B[j])

j = len(B)
for i in range(len(A)+1):
    if a[i] > K:
        continue
    else:
        while b[j] > K - a[i]:
            j -= 1
        max_sum = max(max_sum, i + j)

print(max_sum)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input().strip())
A = [int(v) for v in input().strip().split(" ")]

A = sorted(A)
visited = {}
for i in range(N):
    visited[A[i]] = 0

counter = 0
for i in range(N):
    count_flag = True
    mark = 0
    if visited[A[i]] == 1:
        continue

    for j in range(N):
        if i == j:
            continue
        if A[i] < A[j]:
            break
        if A[i] % A[j] == 0:
            count_flag = False
            mark = j
            break
    if count_flag:
        counter += 1

    for j in range(mark, N):
        if A[i] % A[j] == 0:
            visited[A[j]] = 1

print(counter)

Fixed submission:
N = int(input().strip())
A = [int(v) for v in input().strip().split(" ")]

exist_in_input = [0 for _ in range(10**6 + 1)]
if_can_divide = [0 for _ in range(10**6 + 1)]

for a in A:
    exist_in_input[a] += 1

counter = 0
for i in range(1, 10**6+1):
    if if_can_divide[i] == 1 or exist_in_input[i] == 0:
        continue

    if exist_in_input[i] == 1:
        counter += 1

    for j in range(0, 10**6+1, i):
        if_can_divide[j] = 1

print(counter)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input().strip())
A = [int(v) for v in input().strip().split(" ")]

A = sorted(A)

counter = 0
for i in range(N):
    count_flag = True
    for j in range(N):
        if i == j:
            continue
        if A[i] < A[j]:
            break
        if A[i] % A[j] == 0:
            count_flag = False
            break
    if count_flag:
        counter += 1

print(counter)

Fixed submission:
N = int(input().strip())
A = [int(v) for v in input().strip().split(" ")]

exist_in_input = [0 for _ in range(10**6 + 1)]
if_can_divide = [0 for _ in range(10**6 + 1)]

for a in A:
    exist_in_input[a] += 1

counter = 0
for i in range(1, 10**6+1):
    if if_can_divide[i] == 1 or exist_in_input[i] == 0:
        continue

    if exist_in_input[i] == 1:
        counter += 1

    for j in range(0, 10**6+1, i):
        if_can_divide[j] = 1

print(counter)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input().strip())
A = [int(v) for v in input().strip().split(" ")]

counter = 0
for i in range(N):
    count_flag = True
    for j in range(N):
        if i == j: continue
        if A[i] % A[j] == 0:
            count_flag = False
            break
    if count_flag:
        counter += 1

print(counter)

Fixed submission:
N = int(input().strip())
A = [int(v) for v in input().strip().split(" ")]

exist_in_input = [0 for _ in range(10**6 + 1)]
if_can_divide = [0 for _ in range(10**6 + 1)]

for a in A:
    exist_in_input[a] += 1

counter = 0
for i in range(1, 10**6+1):
    if if_can_divide[i] == 1 or exist_in_input[i] == 0:
        continue

    if exist_in_input[i] == 1:
        counter += 1

    for j in range(0, 10**6+1, i):
        if_can_divide[j] = 1

print(counter)
Buggy python submission (verdict: Time Limit Exceeded):
import copy
N, M, Q = [eval(v) for v in input().strip().split(" ")]

a_list, b_list, c_list, d_list = [], [], [], []

for k in range(Q):
    a, b, c, d = [eval(v) for v in input().strip().split(" ")]
    a_list.append(a)
    b_list.append(b)
    c_list.append(c)
    d_list.append(d)

max_value = 0

def calc_score(complete_A):
    score = 0
    for i in range(Q):
        if complete_A[b_list[i]] - complete_A[a_list[i]] == c_list[i]:
            score += d_list[i]
    return score

def search(A, M, depth, a_list, b_list, c_list, d_list, max_value, count):
    # print("%s: %s" % (depth, A))
    # count += 1
    # if count > 20:
    #     exit(0)
    if depth > 0:
        last_A = A[-1]
        for k in range(last_A, M + 1):
            next_A = copy.deepcopy(A)
            next_A.append(k)
            max_value = search(next_A, M, depth - 1, a_list, b_list, c_list, d_list, max_value, count)
    else:
        value = calc_score(A[1:])
        if value > max_value:
            max_value = value
    return max_value

count = 0
A = [1]
print(search(A, M, N + 1, a_list, b_list, c_list, d_list, max_value, count))

Fixed submission:
# import copy
N, M, Q = [eval(v) for v in input().strip().split(" ")]

a_list, b_list, c_list, d_list = [], [], [], []

for k in range(Q):
    a, b, c, d = [eval(v) for v in input().strip().split(" ")]
    a_list.append(a)
    b_list.append(b)
    c_list.append(c)
    d_list.append(d)

max_value = 0

def calc_score(complete_A):
    score = 0
    for i in range(Q):
        if complete_A[b_list[i]] - complete_A[a_list[i]] == c_list[i]:
            score += d_list[i]
    return score

def search(A, M, depth, a_list, b_list, c_list, d_list, max_value, count):
    # print("%s: %s" % (depth, A))
    # count += 1
    # if count > 20:
    #     exit(0)
    if depth > 0:
        last_A = A[-1]
        for k in range(last_A, M + 1):
            # next_A = copy.deepcopy(A)
            # next_A.append(k)
            next_A = A + [k]
            max_value = search(next_A, M, depth - 1, a_list, b_list, c_list, d_list, max_value, count)
    else:
        value = calc_score(A[1:])
        if value > max_value:
            max_value = value
    return max_value

count = 0
A = [1]
print(search(A, M, N + 1, a_list, b_list, c_list, d_list, max_value, count))
Buggy python submission (verdict: Runtime Error):
A, B, N = [int(v) for v in input().strip().spilt(" ")]

if N < B:
	print(int(A * N * B) - A * int(N / B))
else:
    print(int(A * (B - 1) * B) - A * int((B - 1) / B))

Fixed submission:
A, B, N = [eval(v) for v in input().strip().split(" ")]

if N < B:
    print(int(A * N / B) - A * int(N / B))
else:
    print(int(A * (B - 1) / B) - A * int((B - 1) / B))

Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = [eval(v) for v in input().strip().split(" ")]

max_value = -99999

for x in range(1, N + 1):
    value = int(A * x / B) - A * int(x / B)
    max_value = value if value > max_value else max_value
print(max_value)

Fixed submission:
A, B, N = [eval(v) for v in input().strip().split(" ")]

if N < B:
    print(int(A * N / B) - A * int(N / B))
else:
    print(int(A * (B - 1) / B) - A * int((B - 1) / B))
Buggy python submission (verdict: Runtime Error):
import math
if __name__ = "__main__":
	R = eval(input())
    print(math.pi*R**2)


Fixed submission:
R = float(input())
print(2*3.141592653589793*R)

Buggy python submission (verdict: Runtime Error):
import math
R = input()
print(math.pi*R**2)

Fixed submission:
R = float(input())
print(2*3.141592653589793*R)
Buggy python submission (verdict: Runtime Error):
N = int(input())
C = list(input())
ans = 0
r = 0
l = N - 1
while r+1 < l or r < N - 1:
    if C[r] == 'W':
        while True:
            if C[l] == 'R':
                ans += 1
                l -= 1
                break
            else:
                l -= 1
                if r+1 == l:
                    break
    r += 1
print(ans)

Fixed submission:
N = int(input())
C = list(input())
ans = 0
r = 0
l = N - 1
while r < l:
    if C[r] == 'W':
        while True:
            if C[l] == 'R':
                ans += 1
                l -= 1
                break
            else:
                l -= 1
                if r == l:
                    break
    r += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
C = list(input())
ans = 0
r = 0
l = N - 1
while r+1 != l:
    while True:
        if C[r] != C[l]:
            ans += 1
            break
        else:
            l -= 1
            if r+1 == l:
                break
    r += 1
print(ans)


Fixed submission:
N = int(input())
C = list(input())
ans = 0
r = 0
l = N - 1
while r < l:
    if C[r] == 'W':
        while True:
            if C[l] == 'R':
                ans += 1
                l -= 1
                break
            else:
                l -= 1
                if r == l:
                    break
    r += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

for i in range(K, N):
    tmp1 = 1
    tmp2 = 1
    for j in range(i-K, i):
        tmp1 *= A[j]
        tmp2 *= A[j+1]
    if tmp1 < tmp2:
        print('Yes')
    else:
        print('No')

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

for i in range(K, N):
    if A[i-K] < A[i]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
X, N = map(int, input().split())
P = sorted(list(map(int, input().split())))

c = 100
for x in range(1, 101):
    if x in P:
        continue
    else:
        tmp = abs(X-x)
        if tmp < c:
            c = tmp
            ans = x
print(ans)

Fixed submission:
X, N = map(int, input().split())
if N >= 1:
    P = sorted(list(map(int, input().split())))
else:
    P = []

c = 200
for x in range(-1, 102):
    if x in P:
        continue
    else:
        tmp = abs(X-x)
        if tmp < c:
            c = tmp
            ans = x
print(ans)
Buggy python submission (verdict: Runtime Error):
from math import sqrt
N = int(input())
A = sorted(list(map(int, input().split())))
m = 10**6
dp = [0]*10**6
ans = 0

for a in A:
    for i in range(1, m//a):
        dp[a*i] += 1
for a in A:
    if dp[a] == 1:
        ans += 1

print(ans)

Fixed submission:
N = int(input())
A = sorted(list(map(int, input().split())))
m = A[-1]+1
dp = [0]*(m*2)
ans = 0

for a in A:
    for i in range(0, m//a+1):
        dp[a*i] += 1
for a in A:
    if dp[a] == 1:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = sorted(list(map(int, input().split())))
E = set()
ans = 0
for i in range(N):
    a = A[i]
    if i < N-1:
        if a == A[i+1]:
            E.add(a)
            continue
    if a in E:
        continue
    Flag = True
    for e in E:
        if a%e == 0:
            Flag = False
    if Flag:
        ans += 1
    E.add(a)
print(ans)

Fixed submission:
N = int(input())
A = sorted(list(map(int, input().split())))
m = A[-1]+1
dp = [0]*(m*2)
ans = 0

for a in A:
    for i in range(0, m//a+1):
        dp[a*i] += 1
for a in A:
    if dp[a] == 1:
        ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = map(int, input().split())
A = list(map(int, input().split()))
ans = A[0]
for a in A[1:]:
    ans *= a
if ans > 10**18:
    ans = -1
print(ans)

Fixed submission:
N = map(int, input().split())
A = list(reversed(sorted(list(map(int, input().split())))))
if A[-1] == 0:
    ans = 0
else:
    ans = A[0]
    for a in A[1:]:
        ans *= a
        if ans > 10**18:
            ans = -1
            break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = map(int, input().split())
A = list(map(int, input().split()))
ans = A[0]
if 0 in A:
    ans = 0
else:
    for a in A[1:]:
        ans *= a
    if ans > 10**18:
        ans = -1
print(ans)

Fixed submission:
N = map(int, input().split())
A = list(reversed(sorted(list(map(int, input().split())))))
if A[-1] == 0:
    ans = 0
else:
    ans = A[0]
    for a in A[1:]:
        ans *= a
        if ans > 10**18:
            ans = -1
            break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

N, M = map(int, input().split())
G = [[0]*N for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    G[a-1][b-1] = 1
    G[b-1][a-1] = 1

def bfs(u=0):
    Q = deque([])
    color = ['White']*N
    d = [-1]*N
    d[0] = 0
    Q.append(u)

    while Q:
        u = Q.popleft()
        for v in range(N):
            if G[u][v] == 1 and color[v] == 'White':
                if d[v] != -1:
                    continue
                color[v] = 'Gray'
                d[v] = d[u] + 1
                Q.append(v)
        color[u] = 'Black'
    return d

D = bfs()

if 0 not in D[1:]:
    print('Yes')
    for i in range(1, N):
        print(D.index(D[i]-1)+1)
else:
    print('No')

Fixed submission:
from collections import deque
N, M = map(int, input().split())
G = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)

q = deque([0])
d = [-1 for _ in range(N)]
d[0] = 0
ans = [0]*N
while q:
    p = q.popleft()
    for node in G[p]:
        if d[node] == -1:
            d[node] = d[p] + 1
            q.append(node)
        else:
            if d[node] + 1 == d[p]:
                ans[p] = node + 1
print('Yes')
for i in range(1, N):
    print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))
S = []
S.append(1)
S.append(A[0])
while True:
    idx = S[-1]
    loc = A[idx-1]
    if loc not in S:
        S.append(loc)
    else:
        start = S.index(loc)
        end = len(S)
        span = end - start
        break

if K <= end:
    print(S[K])
else:
    n = (K-start)%span
    print(S[start:][n])

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
idx = 1
S = [idx]
ed = set([idx])

for i in range(1, K+1):
    idx = A[idx-1]
    if idx in ed:
        start = S.index(idx)
        end = len(S)
        n = start + (K - start) % (end - start)
        print(S[n])
        break
    else:
        S.append(idx)
        ed.add(idx)
        continue
else:
    print(idx)

Buggy python submission (verdict: Runtime Error):
from itertools import combinations
import numpy as np
N, M, X = map(int,input().split())
xx = np.array([X]*M)
C = {}
cs = []
for _ in range(N):
    c, *A = map(int,input().split())
    C[c] = A
    cs.append(c)
ans = float('inf')
for i in range(0, N+1):
    for comb in combinations(cs,i):
        tmp = 0
        x = xx.copy()
        for cos in comb:
            tmp += cos
            x -= np.array(C[cos])
        if len(x[x <= 0]) >= M:ans = min(ans,tmp)
if ans == float('inf'):ans = '-1'
print(ans)

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
idx = 1
S = [idx]
ed = set([idx])

for i in range(1, K+1):
    idx = A[idx-1]
    if idx in ed:
        start = S.index(idx)
        end = len(S)
        n = start + (K - start) % (end - start)
        print(S[n])
        break
    else:
        S.append(idx)
        ed.add(idx)
        continue
else:
    print(idx)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
N = int(input())
M = list(range(1, N+1))
A = list(map(int, input().split()))

cnt = 0
for a, b in list(combinations(M, 2)):
    if abs(a-b) == A[a-1]+A[b-1]:
        cnt += 1

print(cnt)

Fixed submission:
from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
D = defaultdict(int)
ans = 0

for i, x in enumerate(A, 1):
    ans += D[i-x]
    D[x+i] += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from math import floor
A, B, N = map(int, input().split())

ans = 0
for x in range(N+1):
    ans = max(ans, floor(A*x/B)-A*floor(x/B))

print(ans)

Fixed submission:
from math import floor
A, B, N = map(int, input().split())
x = B-1 if B <= N else N
ans = floor((A*x)/B)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
s = list(input())
ans = 0
idx = [i for i in range(n)]
for i in itertools.combinations(idx, 3):
    a, b, c = i[0], i[1], i[2]
    if a < b < c:
        if s[a] == s[b] or s[a] == s[c] or s[b] == s[c]:
            continue
        elif b-a == c-b:
            continue
        else:
            ans += 1
print(ans)

Fixed submission:
n = int(input())
s = input()

r_count = s.count("R")
g_count = s.count("G")
b_count = s.count("B")
ans = r_count * g_count * b_count

for i in range(n):
    for d in range(n):
        j = i + d
        k = j + d
        if k >= n:
            break
        if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
                ans -= 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
s = list(input())
ans = 0
idx = [i for i in range(n)]
p = []
for i in list(itertools.permutations(idx, 3)):
    if i[0] < i[1] < i[2]:
        p.append(i)
for a, b, c in p:
    if s[a] == s[b] or s[a] == s[c] or s[b] == s[c]:
        continue
    elif b-a == c-b:
        continue
    else:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
s = input()

r_count = s.count("R")
g_count = s.count("G")
b_count = s.count("B")
ans = r_count * g_count * b_count

for i in range(n):
    for d in range(n):
        j = i + d
        k = j + d
        if k >= n:
            break
        if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
                ans -= 1

print(ans)
Buggy python submission (verdict: Runtime Error):
import collections
n,a,b=map(int,input().split())
mod=10**9+7

N=collections.deque(list(reversed(range(1,n+1))))
dp_fac=[0]*n
dp_bunbo=[1]*n
for i in range(0,n):
    if i==0:
        dp_bunshi=N[0]%mod
    else:
        dp_bunbo[i]=((i+1)*dp_bunbo[i-1])%mod
        dp_bunshi=(N[i]*dp_bunshi)%mod
    dp_fac[i]=dp_bunshi//dp_bunbo[i]
ans=0
for j in range(0,n):
    if (j+1)==a or (j+1)==b:continue
    ans+=dp_fac[j]
print(ans)

Fixed submission:
n, a, b = map(int, input().split())
mod = 10**9+7
total = pow(2, n, mod) - 1

def choose(n, r):
    res = 1
    fac = 1
    for i in range(r):
        res *= n-i
        res %= mod
        fac *= i+1
        fac %= mod
    return res*pow(fac, mod-2, mod)%mod

for i in [a, b]:
    total -= choose(n, i)

print(total%mod)
Buggy python submission (verdict: Runtime Error):
from collections import Counter

n=int(input())
S=[input() for _ in range(n)]

c=Counter(s)
m=max(c.values())
ans = sorted(k for k,v in c.items() if v == m)
print("\n".join(ans))

Fixed submission:
from collections import Counter

n=int(input())
S=[input() for _ in range(n)]

c=Counter(S)
m=max(c.values())
ans = sorted(k for k,v in c.items() if v == m)
print("\n".join(ans))