Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())

A = list(map(int, input().split()))

d = {}
for a in A:
    if a in d:
        d[a] += 1
    else:
        d[a] = 1

ans_all = 0
ans_list = {}
for k, v in d.items():
    if v == 1:
        continue
    if v == 2:
        ans_all += 1
        ans_list[k] = 1
        continue
    ans_all += v*(v-1)/2
    ans_list[k] = v*(v-1)/2 - (v-1)*(v-2)/2

for a in A:
    print(int(ans_all-ans_list[a]))

Fixed submission:
N = int(input())

A = list(map(int, input().split()))

d = {}
for a in A:
    if a in d:
        d[a] += 1
    else:
        d[a] = 1

ans_all = 0
ans_list = {}
for k, v in d.items():
    if v == 1:
        ans_list[k] = 0
        continue
    if v == 2:
        ans_all += 1
        ans_list[k] = 1
        continue
    ans_all += v*(v-1)/2
    ans_list[k] = v*(v-1)/2 - (v-1)*(v-2)/2

for a in A:
    print(int(ans_all-ans_list[a]))
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
Q = int(input())
re_flag = False 
start = ""
finish = ""
for i in range(Q):
    l = input()
    if l == "1":
        re_flag = not bool(re_flag)
    elif len(l) > 1:
        t, f, c = l.split()
        if f == "1":
            if re_flag:
                finish = finish + c
            else:
                start = c + start
        else:
            if re_flag:
                start = c + start
            else:
                finish = finish + c


S = start + S + finish
if re_flag:
    S = S[::-1]
print(S)




Fixed submission:
from collections import deque

S = deque(input())
Q = int(input())
re_flag = False 
start = deque()
finish = deque()
for i in range(Q):
    l = input()
    if l == "1":
        re_flag = not bool(re_flag)
    else:
        t, f, c = l.split()
        if f == "1":
            if re_flag:
                finish.append(c)
            else:
                start.append(c)
        else:
            if re_flag:
                start.append(c)
            else:
                finish.append(c)

S.extend(finish)
S.extendleft(start)

ans = deque()
if re_flag:
    ans.extendleft(S)
else:
    ans = S

print("".join(list(ans)))

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
Q = int(input())

for i in range(Q):
    l = input()
    if l == "1":
        S = S[::-1]
    elif len(l) > 1:
        t, f, c = l.split()
        if f == "1":
            S = c + S
        else:
            S = S + c

print(S)




Fixed submission:
from collections import deque

S = deque(input())
Q = int(input())
re_flag = False 
start = deque()
finish = deque()
for i in range(Q):
    l = input()
    if l == "1":
        re_flag = not bool(re_flag)
    else:
        t, f, c = l.split()
        if f == "1":
            if re_flag:
                finish.append(c)
            else:
                start.append(c)
        else:
            if re_flag:
                start.append(c)
            else:
                finish.append(c)

S.extend(finish)
S.extendleft(start)

ans = deque()
if re_flag:
    ans.extendleft(S)
else:
    ans = S

print("".join(list(ans)))
Buggy python submission (verdict: Runtime Error):
N = int(input())

X = list(map(int, input().split()))

dp = {}

for i in range(N):
    for j in range(min(X), max(X)):
        if j in dp:
            dp[j] += (X[i] - j)**2
        else:
            dp[j] = (X[i] - j)**2

print(min(dp.values()))



Fixed submission:
N = int(input())

X = list(map(int, input().split()))

dp = {}

for i in range(N):
    for j in range(min(X), max(X)+1):
        if j in dp:
            dp[j] += (X[i] - j)*(X[i] - j)
        else:
            dp[j] = (X[i] - j)*(X[i] - j)

print(min(dp.values()))
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
A = []
for i in range(Q):
    a = int(input())
    A.append(a)

for i in range(N):
    if K - (Q - A.count(i+1))> 0:
        print('Yes')
    else:
        print('No')

Fixed submission:
N, K, Q = map(int, input().split())
A = [K-Q]*N
for i in range(Q):
    a = int(input())
    A[a-1] += 1

for i in range(N):
    if A[i]> 0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())

A = list(map(int, input().split()))
A.sort(reverse=True)

for i in range(M):
    A[0] //= 2
    j = 0
    if len(A) > 1:
        while A[j] < A[j+1] and j < len(A):
            A[j] , A[j+1] = A[j+1], A[j]
            j += 1
            if j >= len(A)-1:
                break

print(sum(A))

Fixed submission:
import heapq
import math

N, M = map(int, input().split())

A = list(map(lambda x: -x, map(int, input().split())))
heapq.heapify(A)

for i in range(M):
    tmp = heapq.heappop(A)
    tmp = math.ceil(tmp / 2)
    heapq.heappush(A, tmp)

print(-sum(A))

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

A = list(map(int, input().split()))

for i in range(M):
    A[A.index(max(A))] //= 2

print(sum(A))

Fixed submission:
import heapq
import math

N, M = map(int, input().split())

A = list(map(lambda x: -x, map(int, input().split())))
heapq.heapify(A)

for i in range(M):
    tmp = heapq.heappop(A)
    tmp = math.ceil(tmp / 2)
    heapq.heappush(A, tmp)

print(-sum(A))

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

A = list(map(int, input().split()))


for i in range(M):
    j = A.index(max(A))
    A[j] //= 2

print(sum(A))

Fixed submission:
import heapq
import math

N, M = map(int, input().split())

A = list(map(lambda x: -x, map(int, input().split())))
heapq.heapify(A)

for i in range(M):
    tmp = heapq.heappop(A)
    tmp = math.ceil(tmp / 2)
    heapq.heappush(A, tmp)

print(-sum(A))

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

A = list(map(int, input().split()))

A.sort(reverse=True)

for i in range(M):
    A[0] //= 2
    A.sort(reverse=True)

print(sum(A))

Fixed submission:
import heapq
import math

N, M = map(int, input().split())

A = list(map(lambda x: -x, map(int, input().split())))
heapq.heapify(A)

for i in range(M):
    tmp = heapq.heappop(A)
    tmp = math.ceil(tmp / 2)
    heapq.heappush(A, tmp)

print(-sum(A))
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
order_dict = {}
reversed_dict = {}
Q_dict = {}
have_relationlist = {}
ans = []
for i in range(N):
    if i != 0:
        a, b = map(int, input().split())
        if not a in order_dict:
            order_dict[a] = set()
        if not b in reversed_dict:
            reversed_dict[b] = set()
        order_dict[a].add(b)
        reversed_dict[b].add(a)
    ans.append(0)
    have_relationlist[i+1] = set()
    have_relationlist[i+1].add(i+1)

for b in reversed(range(2, N+1)):
    for a in reversed_dict[b]:
        if a in order_dict:
            have_relationlist[a] |= order_dict[a]
        have_relationlist[a] |= have_relationlist[b]

for i in range(Q):
    p, x = map(int, input().split())
    for a in have_relationlist[p]:
        ans[a-1] += x

print(' '.join(map(str, ans)))

Fixed submission:
N, Q = map(int, input().split())
order_dict = {}
ans = [0]*N

for i in range(N):
    if i != 0:
        a, b = map(int, input().split())
        if not a in order_dict:
            order_dict[a] = set()
        order_dict[a].add(b)
    

for i in range(Q):
    p, x = map(int, input().split())
    ans[p-1] += x

for a in range(N+1):
    if a in order_dict:
        for b in order_dict[a]:
            ans[b-1] += ans[a-1]


print(' '.join(map(str, ans)))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

for i in range(N):
    if i == 0:
        print(max(A[1:]))
    elif i == N - 1:
        print(max(A[:N-1]))
    else:
        print(max(A[:i]+A[i+1:]))

Fixed submission:
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
sortA = sorted(A, reverse=True)
maxA = sortA[0]
secondA = sortA[1]
for i in range(N):
    if A[i] != maxA:
        print(maxA)
    else:
        print(secondA)
Buggy python submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)


A, B, C, D = map(int, input().split())
ans = set()
if A%C == 0:
    c = (B//C) - (A//C) + 1
else:
    c = (B//C) - (A//C)

if A%D == 0:
    d = (B//D) - (A//D) + 1
else:
    d = (B//D) - (A//D)

CD = lcm(C, D)

if A%CD == 0:
    cd = (B//CD) - (A//CD) + 1
else:
    cd = (B//CD) - (A//CD)

print(B - A + 1 - (c+d-cd))

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

def lcm(x, y):
    return (x * y) // gcd(x, y)


A, B, C, D = map(int, input().split())
ans = set()
if A%C == 0:
    c = (B//C) - (A//C) + 1
else:
    c = (B//C) - (A//C)

if A%D == 0:
    d = (B//D) - (A//D) + 1
else:
    d = (B//D) - (A//D)

CD = lcm(C, D)

if A%CD == 0:
    cd = (B//CD) - (A//CD) + 1
else:
    cd = (B//CD) - (A//CD)

print(B - A + 1 - (c+d-cd))

Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
ans = set(list(range(A, B+1)))


for i in range(A//C + 1, B //C + 1):
    if i*C in ans:
        ans.remove(i*C)

for i in range(A//D + 1, B //D + 1):
    if i*D in ans:
        ans.remove(i*D)
    


print(len(ans))

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

def lcm(x, y):
    return (x * y) // gcd(x, y)


A, B, C, D = map(int, input().split())
ans = set()
if A%C == 0:
    c = (B//C) - (A//C) + 1
else:
    c = (B//C) - (A//C)

if A%D == 0:
    d = (B//D) - (A//D) + 1
else:
    d = (B//D) - (A//D)

CD = lcm(C, D)

if A%CD == 0:
    cd = (B//CD) - (A//CD) + 1
else:
    cd = (B//CD) - (A//CD)

print(B - A + 1 - (c+d-cd))

Buggy python submission (verdict: Time Limit Exceeded):
A, B, C, D = map(int, input().split())
ans = set()
for i in range(A,B+1):
    if i % C != 0 and i % D != 0:
        ans.add(i)
    else:
        pass

print(len(ans))

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

def lcm(x, y):
    return (x * y) // gcd(x, y)


A, B, C, D = map(int, input().split())
ans = set()
if A%C == 0:
    c = (B//C) - (A//C) + 1
else:
    c = (B//C) - (A//C)

if A%D == 0:
    d = (B//D) - (A//D) + 1
else:
    d = (B//D) - (A//D)

CD = lcm(C, D)

if A%CD == 0:
    cd = (B//CD) - (A//CD) + 1
else:
    cd = (B//CD) - (A//CD)

print(B - A + 1 - (c+d-cd))
Buggy python submission (verdict: Runtime Error):
n = input()
s = input()

r = 0
b = 0
for c in s:
    if c = "R":
        r = r + 1
    else:
        b = b + 1
if r > b:
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c=map(int,input().split())
if a == b and b == c:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c=input()

if a == b and b == c:
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c=map(int,input().split())
if a == b and b == c:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c,d=input()

if a == b and b == c:
    print("yes")
else:
    print("no")

Fixed submission:
a,b,c=map(int,input().split())
if a == b and b == c:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())

H = list(map(int, input().split()))

dp = {}

dp[1] = 0
dp[2] = abs(H[1]-H[0])

for i in range(3, N+1):
    li = []
    for j in range(1,min(K+1,i)):
        li.append(dp[i-j]+abs(H[i-1]-H[i-(j+1)]))
    dp[i] = min(li)

print(dp[N])

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

H = list(map(int, input().split()))

dp = {}

dp[1] = 0
dp[2] = abs(H[1]-H[0])

for i in range(3, N+1):
    li = []
    for j in range(1,min(K+1,i)):
        li.append(dp[i-j]+abs(H[i-1]-H[i-(j+1)]))
    dp[i] = min(li)

print(dp[N])

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

H = list(map(int, input().split()))

dp = {}

dp[1] = 0
dp[2] = abs(H[1]-H[0])

for i in range(3, N+1):
    li = []
    for j in range(1,K+1):
        if (i - j) > 0:
            li.append(dp[i-j]+abs(H[i-1]-H[i-(j+1)]))
    dp[i] = min(li)

print(dp[N])

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

H = list(map(int, input().split()))

dp = {}

dp[1] = 0
dp[2] = abs(H[1]-H[0])

for i in range(3, N+1):
    li = []
    for j in range(1,min(K+1,i)):
        li.append(dp[i-j]+abs(H[i-1]-H[i-(j+1)]))
    dp[i] = min(li)

print(dp[N])
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

N = int(input())
place = []
d = {}
j = 0
for i in range(N):
    x, y = map(int, input().split())
    place.append((x,y))
    if not (x,y) in d:
        d[(x,y)] = j
        j += 1
N = j

sort_x = sorted(place)
sort_y = sorted(place, key = lambda k:k[1])

edge=[[] for i in range(N)]
flag = False
for x,y in sort_x:
    now = d[(x,y)]
    if flag:
        edge[before].append([x-before_x,now])
        edge[now].append([x-before_x,d[(before_x,before_y)]])
    else:
        flag = True
    before_x = x
    before_y = y
    before = now

flag = False
for x,y in sort_y:
    now = d[(x,y)]
    if flag:
        edge[before].append([y-before_y,now])
        edge[now].append([y-before_y,before])
    else:
        flag = True
    before_x = x
    before_y = y
    before = now

used = [True]*N
edgelist = []
for e in edge[0]:
    heapq.heappush(edgelist,e)
used[0] = False
res = 0

while len(edgelist) != 0:
    minedge = heapq.heappop(edgelist)
    if not used[minedge[1]]:
            continue
    v = minedge[1]
    used[v] = False
    for e in edge[v]:
        if used[e[1]]:
            heapq.heappush(edgelist,e)
    res += minedge[0]

print(res)

Fixed submission:
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1]*n
    
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x
    
    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


N = int(input())
xy = []
uf = UnionFind(N)
d = {}
j = 0
for i in range(N):
    x, y = map(int, input().split())
    if not (x,y) in d:
        d[(x,y)] = j
        xy.append((x,y))
        j += 1
N = len(xy)

xy = sorted(xy, key = lambda x:x[0])

root = []
for i in range(N-1):
    before_x, before_y = xy[i]
    x, y = xy[i+1]
    root.append((d[xy[i]],d[xy[i+1]],x - before_x))

xy = sorted(xy, key = lambda x:x[1])

for i in range(N-1):
    before_x, before_y = xy[i]
    x, y = xy[i+1]
    root.append((d[xy[i]],d[xy[i+1]],y - before_y))

root = sorted(root, key = lambda x:x[2])

ans = 0
for s,g,c in root:
    if uf.same(s,g):
        continue
    else:
        uf.union(s,g)
        ans += c

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# 177 C
N = int(input())
A = list(map(int, input().split()))
ans = 0
mod = 10**9+7
B = []
for i in range(len(A)):
    B.append(A[i]%mod)

for i in range(len(B)-1):
    for j in range(i+1, len(B)):
        ans += B[i]*B[j]
print(ans%mod)

Fixed submission:
# 177 C
N = int(input())
A = list(map(int, input().split()))
mod = 10**9 + 7

sq_sum = sum(map(lambda x: x*x, A))
sum_sq = sum(A) * sum(A)
answer = (sum_sq - sq_sum) // 2

print(answer % mod)

Buggy python submission (verdict: Time Limit Exceeded):
# 177 C
N = int(input())
A = list(map(int, input().split()))
ans = 0
mod = 10**9+7
for i in range(len(A)-1):
    for j in range(i+1, len(A)):
        ans += A[i]*A[j]%mod
print(ans%mod)

Fixed submission:
# 177 C
N = int(input())
A = list(map(int, input().split()))
mod = 10**9 + 7

sq_sum = sum(map(lambda x: x*x, A))
sum_sq = sum(A) * sum(A)
answer = (sum_sq - sq_sum) // 2

print(answer % mod)
Buggy python submission (verdict: Time Limit Exceeded):
# 176 B
N = int(input())
length = len(str(N))
nine = 0
for i in range(1, length+1, 1):
    nine += (N % (10**i))/(10**(i-1))
    N -= N % (10**i)
    
print('Yes') if nine % 9 == 0 else print('No')

Fixed submission:
# 176 B
N = int(input())
    
print('Yes') if N % 9 == 0 else print('No')
Buggy python submission (verdict: Time Limit Exceeded):
# 169 B
N = int(input())
A = list(map(int, input().split()))
ans = A[0]
for i in range(1, N):
    ans *= A[i]
print(ans) if ans <= 10**18 else print(-1)

Fixed submission:
# 169 B
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 1
for i in range(N):
    ans *= A[i]
    if ans > 10**18:
        print(-1)
        break
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
# 168 B
K = int(input())
S = input()
if len(str(S)) =< K:
    print(S)
else:
    print(S[:K]+'...')

Fixed submission:
# 168 B
K = int(input())
S = input()
if len(str(S)) <= K:
    print(S)
else:
    print(S[:K]+'...')
Buggy python submission (verdict: Time Limit Exceeded):
def WalkingTakahashi():
    
    data = list(map(int,input().split()))
    
    position = data[0]
    
    if data[0] == data[2] and data[1]%2 == 0:
        print(data[2])
    
    elif data[0] == data[2] and data[1]%2 == 1:
        print(0)
        
    else:
        for i in range(data[1]):
            
            if abs(position + data[2]) < abs(position - data[2]):
                position = position + data[2]
                
            else:
                position = position - data[2]
                
        print(abs(position))
        
if __name__ == '__main__':
    WalkingTakahashi()




Fixed submission:
def WalkingTakahashi():
    
    data = list(map(int,input().split()))
    
    position = abs(data[0])
    
    m = min(data[1], position//data[2])
    
    position = position - data[2]*m
    
    data[1] = data[1] - m
    
    data[1] %= 2
    
    position = position - data[2]*data[1]
    
    print(abs(position))
    
if __name__ == '__main__':
    WalkingTakahashi()

Buggy python submission (verdict: Time Limit Exceeded):
def WalkingTakahashi():
    
    data = list(map(int,input().split()))
    
    position = data[0]
    
    for i in range(data[1]):
        
        if abs(position + data[2]) < abs(position - data[2]):
            position = position + data[2]
            
        else:
            position = position - data[2]
            
    print(abs(position))
        
if __name__ == '__main__':
    WalkingTakahashi()




Fixed submission:
def WalkingTakahashi():
    
    data = list(map(int,input().split()))
    
    position = abs(data[0])
    
    m = min(data[1], position//data[2])
    
    position = position - data[2]*m
    
    data[1] = data[1] - m
    
    data[1] %= 2
    
    position = position - data[2]*data[1]
    
    print(abs(position))
    
if __name__ == '__main__':
    WalkingTakahashi()
Buggy python submission (verdict: Runtime Error):
import random

def AtCoderContestScheduling():

    Day = int(input())
    value_A = list(map(int,input().split()))
    
    SatisfactionLevel = [0]*26

    for num in range(Day):
        
        value_B = list(map(int,input().split()))
        
        if num == 0:
            SatisfactionLevel = [x + y for (x, y) in zip(SatisfactionLevel, value_B)]
            SumA = sum(value_A)
            SatisfactionLevel = [x - SumA + y for (x, y) in zip(SatisfactionLevel, value_A)]

            print(SatisfactionLevel.index(max(SatisfactionLevel)) + 1)

        else:
            SatisfactionLevel = [x + y for (x, y) in zip(SatisfactionLevel, value_B)]
            value_A_1 = value_A[value_A.index(max(value_A))] = 0
            SumA = sum(value_A)
            SatisfactionLevel = [x - (num + 1)*SumA + 2*y + z for (x, y, z) in zip(SatisfactionLevel, value_A, value_A_1)]

            print(SatisfactionLevel.index(max(SatisfactionLevel)) + 1)
            

if __name__ == '__main__':
    AtCoderContestScheduling()




Fixed submission:
def AtCoderContestScheduling():

    Day = int(input())
    C_i = list(map(int,input().split()))
    
    last_d_i = [0]*26

    SatisfactionLevel_last = 0

    for num in range(1, Day+1):
        
        S_d_i = list(map(int,input().split()))
        
        SatisfactionLevel_list = []
        
        for num2 in range(26):
            SatisfactionLevel = SatisfactionLevel_last + S_d_i[num2]
            
            for num3 in range(26):
                if num2 != num3:
                    SatisfactionLevel = SatisfactionLevel - C_i[num3]*(num - last_d_i[num3])
 
            SatisfactionLevel_list.append(SatisfactionLevel)    

        index = SatisfactionLevel_list.index(max(SatisfactionLevel_list))

        last_d_i[index] = num

        SatisfactionLevel_last = SatisfactionLevel_list[SatisfactionLevel_list.index(max(SatisfactionLevel_list))]

        print(SatisfactionLevel_list.index(max(SatisfactionLevel_list)) + 1)

if __name__ == '__main__':
    AtCoderContestScheduling()
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import math
 
def Strider():
 
    NumA = int(input())
 
    X = 0
    Y = 0

    X_move = 0
    Y_move = 1
    
    count = 1
    kakudo = NumA
    
    while (X!=X_move or Y != Y_move):
        kakudo = kakudo + NumA
        
        X_move = X_move + round(math.cos(math.radians(kakudo)), 3)
        Y_move = Y_move + round(math.sin(math.radians(kakudo)), 3)
        count = count + 1    
    
    print(count)
 
if __name__ == '__main__':
    Strider()


Fixed submission:
# -*- coding: utf-8 -*-
import math
 
def Strider():
 
    NumA = int(input())
 
    count = 360/NumA
    
    NumB = 1
    
    while ((360*NumB % NumA) != 0):
        NumB = NumB + 1
        count = 360*NumB/NumA
    
    print(int(count))
 
if __name__ == '__main__':
    Strider()
Buggy python submission (verdict: Runtime Error):
import numpy as np

def ForbiddenList():

    NumA = list(map(int,input().split()))

    NumB = list(map(int,input().split()))

    result = list(range(min(NumB)-1, max(NumB)+1, 1))

    for data in NumB:
        result.remove(data)

    idx = np.abs(np.asarray(result) - NumA[0]).argmin()

    print(result[idx])

if __name__ == '__main__':
    ForbiddenList()

Fixed submission:
import numpy as np

def ForbiddenList():

    NumA = list(map(int,input().split()))

    NumB = list(map(int,input().split()))

    if len(NumB) != 0:
        result = list(range(min(NumB)-1, max(NumB)+2, 1))

        for data in NumB:
            result.remove(data)

        idx = np.abs(np.asarray(result) - NumA[0]).argmin()

        print(result[idx])

    else:
        print(NumA[0])
    

if __name__ == '__main__':
    ForbiddenList()
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    numbers = int(input())
    number_list = list(map(int, input().split()))
    answer = 0
    for i in range(numbers - 1):
        num1 = number_list[i]
        num2 = sum(number_list[i+1:])
        answer += num1*num2
    print(answer%1000000007)
resolve()

Fixed submission:
def resolve():
    numbers = int(input())
    number_list = list(map(int, input().split()))
    answer = 0
    num2 = sum(number_list)
    for num1 in number_list:
        num2 = num2 - num1
        answer += num1*num2
    print(answer%1000000007)
resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    numbers = int(input())
    number_list = list(map(int, input().split()))
    answer = 0
    for i in range(numbers - 1):
        num1 = number_list[i]
        for j in range(numbers-i-1):
            answer += num1*number_list[i+j+1]
    print(answer%1000000007)
resolve()

Fixed submission:
def resolve():
    numbers = int(input())
    number_list = list(map(int, input().split()))
    answer = 0
    num2 = sum(number_list)
    for num1 in number_list:
        num2 = num2 - num1
        answer += num1*num2
    print(answer%1000000007)
resolve()