Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
sum_ = 0

def gcd(x, y):
    while y != 0:
        r = x % y
        x = y
        y = r
    return x

for i in range(1, k+1):
    for j in range(1, k+1):
        for l in range(1, k+1):
            sum_ += gcd(gcd(i, j), l)
        
print(sum_)

Fixed submission:
import math

k = int(input())
sum_ = 0

for i in range(1, k+1):
    for j in range(1, k+1):
        x = math.gcd(i, j)
        for l in range(1, k+1):
            sum_ += math.gcd(x, l)
            
print(sum_)

Buggy python submission (verdict: Time Limit Exceeded):
import math

k = int(input())
sum_ = 0

for i in range(1, k+1):
    for j in range(1, k+1):
        for l in range(1, k+1):
            sum_ += math.gcd(math.gcd(i, j), l)
            
print(sum_)

Fixed submission:
import math

k = int(input())
sum_ = 0

for i in range(1, k+1):
    for j in range(1, k+1):
        x = math.gcd(i, j)
        for l in range(1, k+1):
            sum_ += math.gcd(x, l)
            
print(sum_)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

k = int(input())
sum_ = 0

for i in range(1, k+1):
    if i == 1:
        sum_ += k ** 2
    else:
        for j in range(1, k+1):
            if j == 1:
                sum_ += k
            else:
                for l in range(1, k+1):
                    if l == 1:
                        sum_ += 1
                    else:
                        sum_ += reduce(math.gcd, [i, j, l])
            
print(sum_)

Fixed submission:
import math

k = int(input())
sum_ = 0

for i in range(1, k+1):
    for j in range(1, k+1):
        x = math.gcd(i, j)
        for l in range(1, k+1):
            sum_ += math.gcd(x, l)
            
print(sum_)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

k = int(input())
sum_ = 0

for i in range(1, k+1):
    for j in range(1, k+1):
        for l in range(1, k+1):
            sum_ += gcd_list([i, j, l])
            
print(sum_)

Fixed submission:
import math

k = int(input())
sum_ = 0

for i in range(1, k+1):
    for j in range(1, k+1):
        x = math.gcd(i, j)
        for l in range(1, k+1):
            sum_ += math.gcd(x, l)
            
print(sum_)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
s = [''] + list(input())
cnt_1 = collections.Counter(s)

sub = 0
for j in range(1, (n+1)//2):
    for i in range(1, n-2*j+1):
        tmp = s[i] + s[i+j] + s[i+j*2]
        cnt_2 = collections.Counter(tmp)
        if max(cnt_2.values()) == 1:
            sub += 1

print((cnt_1['R']*cnt_1['G']*cnt_1['B'])-sub)

Fixed submission:
import collections
n = int(input())
s = [''] + list(input())
cnt_1 = collections.Counter(s)

sub = 0
for j in range(1, (n+1)//2):
    for i in range(1, n-2*j+1):
        tmp = s[i] + s[i+j] + s[i+j*2]
        cnt_2 = collections.Counter(tmp)
        if cnt_2['R'] == 1 and cnt_2['G'] == 1 and cnt_2['B'] == 1:
            sub += 1

print((cnt_1['R']*cnt_1['G']*cnt_1['B'])-sub)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections
import math
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    a = list(map(int, input().split()))
    cnt = dict(collections.Counter(a))
    for i in range(n):
        ans = 0
        cnt[a[i]] -= 1
        for j in cnt.values():
            if j >= 2:
                ans += math.factorial(j)//(2*math.factorial(j-2))
        cnt[a[i]] += 1
        print(ans)
        
if __name__ == '__main__':
    main()

Fixed submission:
import sys
import collections
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    a = list(map(int, input().split()))
    cnt = collections.Counter(a)
    all_comb = 0
    for i in cnt.keys():
        all_comb += cnt[i] * (cnt[i]-1) // 2
    for i in range(n):
        comb = all_comb
        comb -= cnt[a[i]] * (cnt[a[i]]-1) // 2
        comb += (cnt[a[i]]-1) * (cnt[a[i]]-2) // 2
        print(comb)
        
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections
import math
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    a = list(map(int, input().split()))
    cnts = []
    for i in range(n):
        if i == 0:
            tmp = dict(collections.Counter(a[1:])) 
        elif i == n-1:
            tmp = dict(collections.Counter(a[:n-1])) 
        else:
            tmp = dict(collections.Counter(a[:i] + a[i+1:]))
        cnts.append(tmp)
    for cnt in cnts:
        ans = 0
        for x, y in cnt.items():
            if y >= 2:
                ans += math.factorial(y)//(2*math.factorial(y-2))
        print(ans)
        
if __name__ == '__main__':
    main()

Fixed submission:
import sys
import collections
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    a = list(map(int, input().split()))
    cnt = collections.Counter(a)
    all_comb = 0
    for i in cnt.keys():
        all_comb += cnt[i] * (cnt[i]-1) // 2
    for i in range(n):
        comb = all_comb
        comb -= cnt[a[i]] * (cnt[a[i]]-1) // 2
        comb += (cnt[a[i]]-1) * (cnt[a[i]]-2) // 2
        print(comb)
        
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    s = [input() for _ in range(n)]
    cnt = collections.Counter(s)
    d = sorted([k for k, v in cnt.items() if v == max(cnt.values())])
    print(*d, sep='\n')

if __name__ == '__main__':
    main()

Fixed submission:
import sys
import collections
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    s = [input() for _ in range(n)]
    cnt = collections.Counter(s)
    values, counts = zip(*cnt.most_common())
    d = sorted(values[:counts.count(counts[0])])
    print(*d, sep='\n')

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    s = [input() for _ in range(n)]
    cnt = collections.Counter(s)
    d = [k for k, v in cnt.items() if v == max(cnt.values())]
    d = sorted(d)
    for i in d:
        print(i)    

if __name__ == '__main__':
    main()

Fixed submission:
import sys
import collections
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    s = [input() for _ in range(n)]
    cnt = collections.Counter(s)
    values, counts = zip(*cnt.most_common())
    d = sorted(values[:counts.count(counts[0])])
    print(*d, sep='\n')

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections
input = lambda: sys.stdin.readline().rstrip()
 
def main():
    n = int(input())
    s = [input() for _ in range(n)]
    cnt = collections.Counter(s)
    d = sorted([k for k, v in cnt.items() if v == max(cnt.values())])
    for i in d:
        print(i)    
 
if __name__ == '__main__':
    main()

Fixed submission:
import sys
import collections
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    s = [input() for _ in range(n)]
    cnt = collections.Counter(s)
    values, counts = zip(*cnt.most_common())
    d = sorted(values[:counts.count(counts[0])])
    print(*d, sep='\n')

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    s = [input() for _ in range(n)]
    cnt = collections.Counter(s)
    d = sorted([k for k, v in cnt.items() if v == max(cnt.values())])
    for i in d:
        print(i)    

if __name__ == '__main__':
    main()

Fixed submission:
import sys
import collections
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    s = [input() for _ in range(n)]
    cnt = collections.Counter(s)
    values, counts = zip(*cnt.most_common())
    d = sorted(values[:counts.count(counts[0])])
    print(*d, sep='\n')

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, m = map(int, input().split())
    penalty = dict()
    penalty_cnt = 0
    ans = set()
    for _ in range(m):
        num, result = input().split()
        if result == 'AC':
            ans.add(num)
        elif num not in ans:
            if num not in penalty:
                penalty[num] = 1
            else:
                penalty[num] += 1
    ans = list(ans)
    for i in range(len(ans)):
        penalty_cnt += penalty[ans[i]]
    print(len(ans), penalty_cnt)

if __name__ == '__main__':
    main()

Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, m = map(int, input().split())
    penalty = dict()
    penalty_cnt = 0
    ans = set()
    for _ in range(m):
        num, result = input().split()
        if result == 'AC':
            ans.add(num)
            if num not in penalty:
                penalty[num] = 0
        elif num not in ans:
            if num not in penalty:
                penalty[num] = 1
            else:
                penalty[num] += 1
    ans = list(ans)
    for i in range(len(ans)):
        penalty_cnt += penalty[ans[i]]
    print(len(ans), penalty_cnt)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np
import itertools
import math
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    loc = [list(map(int,input().split())) for _ in range(n)]
    arr = np.array(list(itertools.permutations(loc)))
    p = math.factorial(n)
    dis = np.zeros(p)
    for i in range(p):
        for j in range(n-1):
            dis[i] += np.linalg.norm(arr[i][j+1]-arr[i][j])
    print(dis.mean())
    
    
if __name__ == '__main__':
    main()

Fixed submission:
import sys
import itertools
import math
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    loc = [list(map(int,input().split())) for _ in range(n)]
    arr = list(itertools.permutations(loc))
    p = math.factorial(n)
    dis = 0
    for i in range(p):
        for j in range(n-1):
            dis += math.sqrt((arr[i][j+1][1]-arr[i][j][1])**2+(arr[i][j+1][0]-arr[i][j][0])**2)
    print(dis/p)
    
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    a = list(map(int, input().split()))
    ans = []
    for i in range(1, n+1):
        ans.append(a.index(i)+1)
    print(*ans)

if __name__ == '__main__':
    main()

Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    a = list(map(int, input().split()))
    ans = [0] * n
    for i in range(n):
        ans[a[i]-1] = i + 1
    print(*ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    v = list(map(int, input().split()))
    c = list(map(int, input().split()))
    ans = 0
    
    for i in range(2**n):
        value, cost = 0, 0
        for j in range(n):
            if i >> j & 1:
                value += v[j]
                cost += c[j]
        ans = max(ans, value - cost)
    print(ans)
    
if __name__ == '__main__':
    main()

Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    v = list(map(int, input().split()))
    c = list(map(int, input().split()))
    ans = 0
    for i in range(n):
        if v[i] > c[i]:
            ans += v[i] - c[i]
    print(ans)
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    s = list(input())
    ans = 0
    while(True):
        if s == [] or len(s) == 1:
            print(ans*2)
            return
        for i in range(1, len(s)):
            if (s[i-1]=='0' and s[i]=='1') or (s[i-1]=='1' and s[i]=='0'):
                ans += 1
                s.pop(i)
                s.pop(i-1)
                break
            if i == len(s)-1:
                print(ans*2)
                return
        
if __name__ == '__main__':
    main()

Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    s = list(input())
    print(min(s.count('0'), s.count('1')) * 2)
        
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
N = int(input())
#開業されたN個要素を受け付ける
#list = [input() for i in range(N)]
#input_list = [list(map(int, input().split())) for i in range(N)]

ans = ""
if N%10 == 0:
    ans = "pon"
elif N%10 = 1:
    ans = "pon"
elif N%10 = 2:
    ans = "hon"
elif N%10 = 3:
    ans = "bon"
elif N%10 = 4:
    ans = "hon"
elif N%10 = 5:
    ans = "hon"
elif N%10 = 6:
    ans = "pon"
elif N%10 = 7:
    ans = "hon"
elif N%10 = 8:
    ans = "pon"
elif N%10 = 9:
    ans = "hon"

print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
N = int(input())
#開業されたN個要素を受け付ける
#list = [input() for i in range(N)]
#input_list = [list(map(int, input().split())) for i in range(N)]

ans = ""
if N%10 == 0:
    ans = "pon"
elif N%10 == 1:
    ans = "pon"
elif N%10 == 2:
    ans = "hon"
elif N%10 == 3:
    ans = "bon"
elif N%10 == 4:
    ans = "hon"
elif N%10 == 5:
    ans = "hon"
elif N%10 == 6:
    ans = "pon"
elif N%10 == 7:
    ans = "hon"
elif N%10 == 8:
    ans = "pon"
elif N%10 == 9:
    ans = "hon"

print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
s = input()
#開業されたN個要素を受け付ける
#list = [input() for i in range(N)]


if s==ABC:
    print("ARC")
else:
    print("ABC")


Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
s = input()
#開業されたN個要素を受け付ける
#list = [input() for i in range(N)]


if s=="ABC":
    print("ARC")
else:
    print("ABC")
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N, M = map(int, input().split())
# 文字列の入力
H_list = list(map(int, input().split()))
#print(H_list)
#開業されたN個要素を受け付ける
road_list = []
for i in range(M):
    road_list.append(list(map(int, input().split())))
#print(road_list)
ans = 0
for i in range(N):
    #print(i+1)
    flg = 1
    for road in road_list:
        if i+1 in road:
            if i+1 == road[0] and H_list[road[0]-1] <= H_list[road[1]-1]:
                flg=0
            elif i+1 == road[1] and H_list[road[1]-1] <= H_list[road[0]-1]:
                flg=0
    if flg==1:
        #print("flg")
        ans=ans+1
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N, M = map(int, input().split())
# 文字列の入力
H_list = list(map(int, input().split()))
#print(H_list)
#開業されたN個要素を受け付ける
road_list = []
for i in range(M):
    road_list.append(list(map(int, input().split())))
    #road_list.append(input())
#print(road_list)
flg_list=[]
for i in range(N):
    flg_list.append(1)

#print(flg_list)

ans = 0
'''
for i in range(N):
    #print(i+1)
    flg = 1
    for road in road_list:
        if i+1 in road:
            if i+1 == road[0] and H_list[road[0]-1] <= H_list[road[1]-1]:
                flg=0
            elif i+1 == road[1] and H_list[road[1]-1] <= H_list[road[0]-1]:
                flg=0
    if flg==1:
        #print("flg")
        ans=ans+1
'''
for road in road_list:
    if H_list[road[0]-1] < H_list[road[1]-1]:
        flg_list[road[0]-1]=0
    elif H_list[road[1]-1] < H_list[road[0]-1]:
        flg_list[road[1]-1]=0
    else:
        flg_list[road[0]-1]=0
        flg_list[road[1]-1]=0
for i in range(N):
    if flg_list[i]==1:
        ans=ans+1


print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
S, W = map(int, input().split())
# 文字列の入力
#s = input()
#print(s[0:K-1]+s[K-1].lower()+s[K:N])

if S <= W:
    print("unsafe")
else:
    print("safe")


Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
A, B, C, D = map(int, input().split())
# 文字列の入力
#s = input()
#print(s[0:K-1]+s[K-1].lower()+s[K:N])

while(1):
    C = C-B
    if C <= 0:
        print("Yes")
        break
    A = A-D
    if A <= 0:
        print("No")
        break
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N = int(input())
list = []
# 文字列の入力
for i in range(N):
    s = input()
    if not s in list:
        list.append(s)

#print(list)
print(len(list))


Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
N = int(input())
list = []
# 文字列の入力
for i in range(N):
    s = input()
    list.append(s)
    #if not s in list:
        #list.append(s)

#print(list)
print(len(set(list)))

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
N = int(input())
list = []
# 文字列の入力
for i in range(N):
    s = input()
    if not s in list:
        list.append(s)

#print(list)
print(len(list))


Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
N = int(input())
list = []
# 文字列の入力
for i in range(N):
    s = input()
    list.append(s)
    #if not s in list:
        #list.append(s)

#print(list)
print(len(set(list)))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
A, B, C, D = map(int, input().split())
# 文字列の入力
#s = input()
#print(s[0:K-1]+s[K-1].lower()+s[K:N])

while(1):
    C = C-B
    if C <= 0:
        print("Yes")
        break
    A = A-D
    if A <= 0:
        print("No")
        break


Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
N = int(input())
list = []
# 文字列の入力
for i in range(N):
    s = input()
    list.append(s)
    #if not s in list:
        #list.append(s)

#print(list)
print(len(set(list)))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
N = int(input())
# 文字列の入力
s = input()
t = s.split(" ")
ans = []

for i in range(N):
    num = 0
    for j in range(len(t)):
        if int(t[j]) == i+1:
            num=num+1
    ans.append(num)

for i in ans:
    print(i)


Fixed submission:
# -*- coding: utf-8 -*-
N = int(input())
# 文字列の入力
s = input()
t = s.split(" ")
#print(t)
ans = []
for i in range(N):
    ans.append(0)

#print(ans)

for i in range(len(t)):
    ans[int(t[i])-1]=ans[int(t[i])-1]+1

for i in ans:
    print(i)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
N = int(input())
#開業されたN個要素を受け付ける
list = [int(input()) for i in range(N)]

list=sorted(list)
list.reverse()
#print(list)

ans = 0

for i, l in enumerate(list):
    if i==0:
        ans = l/2
    else:
        ans = ans + l

print(int(ans)


Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
N = int(input())
#開業されたN個要素を受け付ける
list = [int(input()) for i in range(N)]

list=sorted(list)
list.reverse()
#print(list)

ans = 0

for i, l in enumerate(list):
    if i==0:
        ans = l/2
    else:
        ans = ans + l

print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
S = input()
n=0
flg=0
#print(s[0:K-1]+s[K-1].lower()+s[K:N])
while(not S==""):

#    if  S[n:].startswith("dreameraser"):
#        n=n+11
        #print(S[n:])
        #flg==1
#        continue
    if S.endswith("dreamer"):
        #n=n+6
        S=S[::-1]
        S=S.replace("dreamer","",1)
        S=S[::-1]
        #print(S[n:])
        continue
    elif S.endswith("dream"):
        #n=n+5
        S=S[::-1]
        S=S.replace("dream","",1)
        S=S[::-1]
        #print(S)
        #flg==1
        continue
    elif S.endswith("eraser"):
        #n=n+6
        S=S[::-1]
        S=S.replace("eraser","",1)
        S=S[::-1]
        #print(S[n:])
        continue
    elif S.endswith("erase"):
        #n=n+5
        S=S[::-1]
        S=S.replace("erase","",1)
        S=S[::-1]
        #print(S)
        #flg==1
        continue
    print("NO")
    exit()

print("YES")


Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
S = input()
n=0
flg=0
#print(s[0:K-1]+s[K-1].lower()+s[K:N])
S=S[::-1]
while(not S==""):

#    if  S[n:].startswith("dreameraser"):
#        n=n+11
        #print(S[n:])
        #flg==1
#        continue
    if S.startswith("remaerd"):
        #n=n+6
        S=S.replace("remaerd","",1)
        #print(S[n:])
        continue
    elif S.startswith("maerd"):
        #n=n+5
        S=S.replace("maerd","",1)
        #print(S)
        #flg==1
        continue
    elif S.startswith("resare"):
        #n=n+6
        S=S.replace("resare","",1)
        #print(S[n:])
        continue
    elif S.startswith("esare"):
        #n=n+5
        S=S.replace("esare","",1)
        #print(S)
        #flg==1
        continue
    print("NO")
    exit()

print("YES")
Buggy python submission (verdict: Runtime Error):
#C
import numpy as np
x, n = map(int, input().split())

if n!=0:
    p_list = list(map(int, input().split()))
    
    if n%2==0:
        kouho = list(range((x-n//2-1),(x+n//2)))
    else:
        kouho = list(range((x-n//2-1),(x+n//2+1)))
        kouho2 = set(kouho) - set(p_list)
        ans = [j for i, j in enumerate(list(kouho2)) if abs(j-x) == min(abs(np.array(list(kouho2)) - x))]
        ans = min(ans)

else:
    ans = [x]

print(ans)

Fixed submission:
#C
import numpy as np
x, n = map(int, input().split())

if n!=0:
    p_list = list(map(int, input().split()))
    kouho = list(range((x-n//2-1),(x+n//2+1)))    
    kouho2 = list(set(kouho) - set(p_list))
    ans = [j for i, j in enumerate(kouho2) if abs(j-x) == min(abs(np.array(kouho2) - x))]
    ans = min(ans)

else:
    ans = x

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

# r_list = []
# for i in range(n+1):
#     r_list.append(a_list.count(i))

# n = 5
# a_list = [1,1,2,2]

r_list = map(a_list.count, range(n+1))
r_list = list(r_list)
r_list2 = map(str, r_list[1:])
r_list2 = list(r_list2)

ans = "\n".join(r_list2)

print(ans)

Fixed submission:
r = int(input())

import math

print(math.pi*2*r)

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

print(math.pi* 2 * r)

Fixed submission:
r = int(input())

import math

print(math.pi*2*r)

Buggy python submission (verdict: Runtime Error):
r = int(input())
import numpy

print(math.pi*2*r)

Fixed submission:
r = int(input())

import math

print(math.pi*2*r)