Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq


def dfs(s, prev, pre):
  val[s] += Ope[s] + prev
  for i in G[s]:
    if(i == pre):
      continue
    dfs(i, val[s], s)

def bfs(sx, sy, n):
  que = deque([[sy,sx]])
  while que:
    y,x = que.popleft()
    for i,j in D:
      if(x+i<0 or y+j<0 or x+i>W-1 or y+j>H-1):
        continue
      dist = G[y+j][x+i]
      if(G[y+j][x+i] != "X"):
        if(type(G[y+j][x+i]) is str):
          G[y+j][x+i] = G[y][x]+1
          que.append([y+j,x+i])
        elif(dist>G[y][x]+1):
          G[y+j][x+i] = G[y][x]+1
          que.append([y+j,x+i])
        

def combinations_count(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]



N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
ans = 0

A.sort()
B.sort()
C.sort()


for i in range(N):
  temp = bisect.bisect_left(B, A[i]+1)
  for j in range(temp, N):
    ans += (N-bisect.bisect_left(C, B[j]+1))


print(ans)


Fixed submission:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq


def dfs(s, prev, pre):
  val[s] += Ope[s] + prev
  for i in G[s]:
    if(i == pre):
      continue
    dfs(i, val[s], s)

def bfs(sx, sy, n):
  que = deque([[sy,sx]])
  while que:
    y,x = que.popleft()
    for i,j in D:
      if(x+i<0 or y+j<0 or x+i>W-1 or y+j>H-1):
        continue
      dist = G[y+j][x+i]
      if(G[y+j][x+i] != "X"):
        if(type(G[y+j][x+i]) is str):
          G[y+j][x+i] = G[y][x]+1
          que.append([y+j,x+i])
        elif(dist>G[y][x]+1):
          G[y+j][x+i] = G[y][x]+1
          que.append([y+j,x+i])
        

def combinations_count(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]



N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
AA = [0]*N
BB = [0]*N
ans = 0

A.sort()
B.sort()
C.sort()


for i in range(N):
  AA[i] = bisect.bisect_right(A, B[i]-1)

for j in range(N):
  BB[j] = bisect.bisect_left(C, B[j]+1)

for k in range(N):
  ans += AA[k]*(N-BB[k])

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
xys = [list(map(int, input().split())) for _ in range(N)]

def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]

unique_xys = get_unique_list(xys)

max_list = []
max_dis = 0
for xy in unique_xys:
    dist = abs(xy[0]) + abs(xy[1])

    if(dist > max_dis):
        max_list = []
        max_list.append(xy)
        max_dis = dist

    elif(dist == max_dis):
        max_list.append(xy)

#print(max_list)

ans = 0

for siten in max_list:
    for syuten in unique_xys:
        dist = abs(siten[0] - syuten[0]) + abs(siten[1] - syuten[1])
        ans = max(ans, dist)

print(ans)

Fixed submission:
N = int(input())
xys = set([tuple(map(int, input().split())) for _ in range(N)])

z = []
w = []

for xy in xys:
    z.append(xy[0]+xy[1])
    w.append(xy[0]-xy[1])

#print(z)
#print(w)

print(max(abs(max(z) - min(z)), abs(max(w) - min(w))))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().split()))

Asum = sum(As)

ans = 0
for index, A in enumerate(As):
    Asum = sum(As)
    ans += (A * (Asum - A))
    ans = ans % (10**9+7)

#    print(As)
    As = As[1:]
#    print(As)

print(ans)

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

Asum = sum(As)

ans = 0
for index, A in enumerate(As):
    ans += (A * (Asum - A))
    ans = ans % (10**9+7)
    Asum -= A
#    print(
#    print(As)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,M = list(map(int, input().split()))
ABs = [list(map(int, input().split())) for _ in range(M)]

checker = []

detacheck = [0 for _ in range(N)]


#for AB in ABs:
#    checker[AB[0] - 1].add(AB[1])
#    checker[AB[1] - 1].add(AB[0])

tmp = 0
for AB in ABs:
#    print(detacheck)
    if(detacheck[AB[0] -1] == 0 and detacheck[AB[1] -1] == 0):
        checker.append(set(AB))
        tmp += 1
        detacheck[AB[0] - 1] = tmp
        detacheck[AB[1] - 1] = tmp


    elif(detacheck[AB[0] -1] == 0 or detacheck[AB[1] -1] == 0):
#        print(detacheck[AB[0] -1] , detacheck[AB[1] -1])
        checker[max(detacheck[AB[0] -1]-1,detacheck[AB[1] -1]-1)].add(AB[0])
        checker[max(detacheck[AB[0] -1]-1,detacheck[AB[1] -1]-1)].add(AB[1])

        detacheck[AB[0] - 1] = max(detacheck[AB[0] - 1],detacheck[AB[1] - 1])
        detacheck[AB[1] - 1] = max(detacheck[AB[0] - 1],detacheck[AB[1] - 1])

    else:
#        print(AB[0], AB[1])
        checker[detacheck[AB[0] -1]-1] = checker[detacheck[AB[0] -1]-1].union(checker[detacheck[AB[1] -1]-1])
        for i in checker[detacheck[AB[1] -1]-1]:
            detacheck[i-1] =  detacheck[AB[0] - 1]
#    print(checker)

ans = 1

for anscheck in checker:
#    print(anscheck, len(anscheck))
    ans = max(ans, len(anscheck))


print(ans)

Fixed submission:
import numpy as np

N,M = list(map(int, input().split()))
ABs = [list(map(int, input().split())) for _ in range(M)]


par = [i for i in range(N+1)]
size = [1 for _ in range(N+1)]

def find(x):
    if par[x] == x:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]
def same(x,y):
    return find(x) == find(y)
def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return 0
    par[x] = y
    size[y] = size[x] + size[y]
    size[x] = 0

for AB in ABs:
    unite(AB[0],AB[1])

print(max(size))
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())

#偶数、5の倍数はありえない
if(K % 2 == 0):
    print(-1)
    exit()

if(K % 5 == 0):
    print(-1)
    exit()

ans = 1
tmp = 7
for i in range(1*10**6):
    if tmp % K == 0:
        print(ans)
        exit()
    
    ans += 1
    tmp += (7 * 10**(ans-1)) % K
#    print(ans, tmp)

print(-1)


Fixed submission:
K = int(input())

#偶数、5の倍数はありえない
if(K % 2 == 0):
    print(-1)
    exit()

if(K % 5 == 0):
    print(-1)
    exit()

ans = 1
tmp = 7
for i in range(1*10**6):
    if tmp % K == 0:
        print(ans)
        exit()
    
    hoge = tmp % K
    ans += 1
    tmp = hoge * 10 + 7
#    print(ans, tmp)

print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


N = int(input())

ans = 1

if(N == 1):
    print(ans)
    exit()

for i in range(2, N+1):
    tmp = factorization(i)

#    print(tmp)
    sumnum = 1
    for j in tmp:
        sumnum *= (j[1]+1)

    ans += i * sumnum
#    print(ans)

print(ans)


Fixed submission:
import numpy as np

N = int(input())

Xarray = np.arange(1, N+1)
Xans = ((N // Xarray) * (2 * Xarray + ((N // Xarray) - 1) * Xarray)) // 2

print(sum(Xans))

Buggy python submission (verdict: Time Limit Exceeded):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


N = int(input())

ans = 1

if(N == 1):
    print(ans)
    exit()

for i in range(2, N+1):
    tmp = factorization(i)

#    print(tmp)
    sumnum = 1
    for j in tmp:
        sumnum *= (j[1]+1)

    ans += i * sumnum
#    print(ans)

print(ans)


Fixed submission:
import numpy as np

N = int(input())

Xarray = np.arange(1, N+1)
Xans = ((N // Xarray) * (2 * Xarray + ((N // Xarray) - 1) * Xarray)) // 2

print(sum(Xans))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
As = list(map(int, input().split()))
Q = int(input())
BCs = [list(map(int, input().split())) for _ in range(Q)]

#rint(BCs)

ansArray = np.zeros(10**5 + 1, dtype = int)
indexArray = np.array(range(10**5+1))

for A in As:
    ansArray[A] += 1

#print(ansArray)
#print(indexArray)

for BC in BCs:

    ansArray[BC[1]] += ansArray[BC[0]]
    ansArray[BC[0]] = 0

    print(np.dot(ansArray, indexArray))



Fixed submission:
import numpy as np

N = int(input())
As = list(map(int, input().split()))
Q = int(input())
BCs = [list(map(int, input().split())) for _ in range(Q)]

#rint(BCs)

ansArray = np.zeros(10**5 + 1, dtype = int)
indexArray = np.array(range(10**5+1))

for A in As:
    ansArray[A] += 1

#print(ansArray)
#print(indexArray)
ans = np.dot(ansArray, indexArray)

for BC in BCs:

    ans = ans + (BC[1] - BC[0]) * ansArray[BC[0]]
    print(ans)
    ansArray[BC[1]] += ansArray[BC[0]]
    ansArray[BC[0]] = 0

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
As = list(map(int, input().split()))
Q = int(input())
BCs = [list(map(int, input().split())) for _ in range(Q)]

#rint(BCs)

ansArray = np.zeros(10**5 + 1, dtype = int)
indexArray = np.array(range(10**5+1))

for A in As:
    ansArray[A] += 1

#print(ansArray)
#print(indexArray)

for BC in BCs:
    B = BC[0]
    C = BC[1]

    tmp = ansArray[B]
    ansArray[B] = 0
    ansArray[C] += tmp

    print(np.dot(ansArray, indexArray))



Fixed submission:
import numpy as np

N = int(input())
As = list(map(int, input().split()))
Q = int(input())
BCs = [list(map(int, input().split())) for _ in range(Q)]

#rint(BCs)

ansArray = np.zeros(10**5 + 1, dtype = int)
indexArray = np.array(range(10**5+1))

for A in As:
    ansArray[A] += 1

#print(ansArray)
#print(indexArray)
ans = np.dot(ansArray, indexArray)

for BC in BCs:

    ans = ans + (BC[1] - BC[0]) * ansArray[BC[0]]
    print(ans)
    ansArray[BC[1]] += ansArray[BC[0]]
    ansArray[BC[0]] = 0
Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
As = list(map(int, input().split()))

B = np.zeros(11 * 10**8, dtype = "uint32")

ans = 0

for index, A in enumerate(As):
    if(index - A >= 0):
        ans += B[index-A]

    B[index+A] += 1
#    print(list(B[:20]))

print(ans)


Fixed submission:
from collections import defaultdict
import numpy as np
import collections

N = int(input())
As = list(map(int, input().split()))

B = defaultdict(int)

ans = 0

for index, A in enumerate(As):
    ans += B[index-A]
    
    B[index+A] += 1
#    print(B)
#    print(list(B[:20]))

print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
As = list(map(int, input().split()))

B = np.zeros(3 * 10**9, dtype = "int32")

ans = 0

for index, A in enumerate(As):
    ans += B[index-A]

    B[index+A] += 1
#    print(list(B[:20]))

print(ans)


Fixed submission:
from collections import defaultdict
import numpy as np
import collections

N = int(input())
As = list(map(int, input().split()))

B = defaultdict(int)

ans = 0

for index, A in enumerate(As):
    ans += B[index-A]
    
    B[index+A] += 1
#    print(B)
#    print(list(B[:20]))

print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
As = list(map(int, input().split()))

B = np.zeros(2 * 10**9, dtype = int)

ans = 0

for index, A in enumerate(As):
    if(index - A >= 0):
        ans += B[index-A]

    B[index+A] += 1
#    print(list(B[:20]))

print(ans)


Fixed submission:
from collections import defaultdict
import numpy as np
import collections

N = int(input())
As = list(map(int, input().split()))

B = defaultdict(int)

ans = 0

for index, A in enumerate(As):
    ans += B[index-A]
    
    B[index+A] += 1
#    print(B)
#    print(list(B[:20]))

print(ans)

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

ans = 0
for i in range(len(As)):
    for j in range(i+1, len(As)):
        if (abs(i - j ) == As[i] + As[j]):
            ans += 1

print(ans)

Fixed submission:
from collections import defaultdict
import numpy as np
import collections

N = int(input())
As = list(map(int, input().split()))

B = defaultdict(int)

ans = 0

for index, A in enumerate(As):
    ans += B[index-A]
    
    B[index+A] += 1
#    print(B)
#    print(list(B[:20]))

print(ans)
Buggy python submission (verdict: Runtime Error):
S, W = list(map(int, input().split))

if W >= S:
  print("unsafe")

else:
  print("safe")

Fixed submission:
S, W = list(map(int, input().split()))
 
if W >= S:
  print("unsafe")
 
else:
  print("safe")
Buggy python submission (verdict: Runtime Error):
3
apple
orange
apple

Fixed submission:
import collections

N = int(input())
S = list(input() for _ in range(N))

setS = set(S)

print(len(setS))
Buggy python submission (verdict: Runtime Error):
N, M = input().split()
A = input().split()

N = int(N)
M = int(M)
print(N,M,A)

sum = 0
for i in A:
    sum += int(i)

print(sum)

Fixed submission:
R = int(input())
ans = R * 2 * 3.1415
print(ans)
Buggy python submission (verdict: Runtime Error):
N, M = input().split()
A = input().split()

N = int(N)
M = int(M)
#print(N,M,A)

sum = 0
for i in A:
    sum += int(i)

#print(sum)

ans = N - sum
if(ans > = 0):
    print(ans)
else:
    print(-1)

Fixed submission:
N, M = input().split()
A = input().split()

N = int(N)
M = int(M)
#print(N,M,A)

sum = 0
for i in A:
    sum += int(i)

#print(sum)

ans = N - sum
if(ans >= 0):
    print(ans)
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = input().split(' ')

intAList = [int(i) for i in A]
sortA = sorted(intAList)
#print(sortA)

for i in range(1,N+1):
  hoge = sortA.count(i)
  print(hoge)
  sortA = sortA[hoge:]

Fixed submission:
N = int(input())
A = input().split(' ')

intAList = [int(i) for i in A]

backet = list([0]*N)
#print(backet)

for i in intAList:
  backet[i-1] += 1

for i in backet:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = input().split(' ')

intAList = [int(i) for i in A]
#sortA = sorted(intAList)
#print(sortA)

for i in range(1,N+1):
  print(intAList.count(i))

Fixed submission:
N = int(input())
A = input().split(' ')

intAList = [int(i) for i in A]

backet = list([0]*N)
#print(backet)

for i in intAList:
  backet[i-1] += 1

for i in backet:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = input().split(' ')

intAList = [int(i) for i in A]
sortA = sorted(intAList)

for i in range(1,N+1):
  print(sortA.count(i))

Fixed submission:
N = int(input())
A = input().split(' ')

intAList = [int(i) for i in A]

backet = list([0]*N)
#print(backet)

for i in intAList:
  backet[i-1] += 1

for i in backet:
  print(i)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = input().split()

CalcList = tuple(range(int(K), int(N)+2))

#print(CalcList)

ans = 0

for i in CalcList:
    tmp = 0
    min = sum(range(0,i))
#    print(min)
    max = i * int(N) -min
#    print(max)

    tmp = max - min +1
    ans += tmp

ans = ans % (10 ** 9 +7)
    
print(ans)


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

CalcList = tuple(range(int(K), int(N)+2))
N = int(N)
#print(CalcList)

ans = 0

for i in CalcList:
    tmp = 0
    min = i * (i-1) /2
#    print(min)
    max = i * N -min
#    print(max)

    tmp = max - min +1
    ans += tmp

ans = ans % (10 ** 9 +7)
    
print(int(ans))

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

CalcList = list(range(int(K), int(N)+2))

#print(CalcList)

ans = 0

for i in CalcList:
    tmp = 0
    min = sum(range(0,i))
#    print(min)
    max = i * int(N) -min
#    print(max)

    tmp = max - min +1
    ans += tmp

print(ans % 1000000007)

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

CalcList = tuple(range(int(K), int(N)+2))
N = int(N)
#print(CalcList)

ans = 0

for i in CalcList:
    tmp = 0
    min = i * (i-1) /2
#    print(min)
    max = i * N -min
#    print(max)

    tmp = max - min +1
    ans += tmp

ans = ans % (10 ** 9 +7)
    
print(int(ans))
Buggy python submission (verdict: Runtime Error):
n,k = list(map(int, input().split))

print(min(n % k, abs(k - (n % k))))

Fixed submission:
n,k = list(map(int, input().split()))

print(min(n % k, abs(k - (n % k))))
Buggy python submission (verdict: Runtime Error):
N = int(input())

d = {}

for i in range(N):
    s = input()
    if s in d:
        d[s] = d[s] + 1
    else:
        d[s] = 1

hoge = max(d.values)

max_kv_list = [kv[0] for kv in d.items() if kv[1] == hoge]

max_kv_list = sorted(max_kv_list)
for ans in max_kv_list:
    print(ans)

Fixed submission:
N = int(input())

d = {}

for i in range(N):
    s = input()
    if s in d:
        d[s] = d[s] + 1
    else:
        d[s] = 1

hoge = max(d.values())

max_kv_list = [kv[0] for kv in d.items() if kv[1] == hoge]

max_kv_list = sorted(max_kv_list)
for ans in max_kv_list:
    print(ans)

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

d = {}

for i in range(N):
    s = input()
    if s in d:
        d[s] = d[s] + 1
    else:
        d[s] = 1


max_kv_list = [kv[0] for kv in d.items() if kv[1] == max(d.values())]
max_kv_list = sorted(max_kv_list)
for ans in max_kv_list:
    print(ans)

Fixed submission:
N = int(input())

d = {}

for i in range(N):
    s = input()
    if s in d:
        d[s] = d[s] + 1
    else:
        d[s] = 1

hoge = max(d.values())

max_kv_list = [kv[0] for kv in d.items() if kv[1] == hoge]

max_kv_list = sorted(max_kv_list)
for ans in max_kv_list:
    print(ans)
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())

tmp = math.inf
ans = 0
for P in list(map(int,input().split())):
    if P <= tmp:
        tmp = P
        ans += 1

print(ans)

Fixed submission:
import math

N = int(input())

tmp = 10 ** 30
ans = 0
for P in list(map(int,input().split())):
    if P <= tmp:
        tmp = P
        ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
print

true_ans = 10 ** 12
for i in range(1,N):
    if N % i == 0:
        ans = N // i
        true_ans = min(ans + i - 2, true_ans)
        if(i > N ** 0.5):
            break

print(true_ans)

Fixed submission:
N = int(input())

n_hoge = int(N ** 0.5)
print

true_ans = 10 ** 12
for i in range(1,n_hoge+1):
    if N % i == 0:
        ans = N // i
        true_ans = min(ans + i - 2, true_ans)

print(true_ans)

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

n_sq = N ** 0.5

n_sq_int = int(n_sq // 1)

#print(n_sq_int)

for i in reversed(range(n_sq_int)):
    if N % i == 0:
        ans = N // i
        print(ans + i - 2)
        exit()

Fixed submission:
N = int(input())

n_hoge = int(N ** 0.5)
print

true_ans = 10 ** 12
for i in range(1,n_hoge+1):
    if N % i == 0:
        ans = N // i
        true_ans = min(ans + i - 2, true_ans)

print(true_ans)
Buggy python submission (verdict: Runtime Error):
N,K,Q = list(map(int , input().split()))
As = [int(input()) for _ in range(Q)]

#特典初期設定
Score = [K for _ in range(N)]

for A in As:
    Score -= 1
    Score[A - 1] += 1

for ans in Score:
    if(ans > 0):
        print("Yes")
    
    else:
        print("No")


Fixed submission:
N,K,Q = list(map(int , input().split()))
As = [int(input()) for _ in range(Q)]

#特典初期設定
Score = [0 for _ in range(N)]

for A in As:
    Score[A-1] +=1

for ans in Score:
    if(K + ans - Q > 0):
        print("Yes")
    
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,K,Q = list(map(int , input().split()))
As = [int(input()) for _ in range(Q)]

#特典初期設定
Score = np.ones(N,dtype = int)
Score = Score * K

for A in As:
    Score -= 1
    Score[A - 1] += 1

for ans in Score:
    if(ans > 0):
        print("Yes")
    
    else:
        print("No")


Fixed submission:
N,K,Q = list(map(int , input().split()))
As = [int(input()) for _ in range(Q)]

#特典初期設定
Score = [0 for _ in range(N)]

for A in As:
    Score[A-1] +=1

for ans in Score:
    if(K + ans - Q > 0):
        print("Yes")
    
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

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

As.sort()

#print(As)

for _ in range(M):
    discount = As.pop(-1)

    if(discount == 0):
        break

    discount //= 2

    i = bisect.bisect_left(As, discount)
    As.insert(i, discount)
#    print(As)

print(sum(As))

Fixed submission:
import bisect

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

As.sort()

#print(As)

for _ in range(M):
    discount = As.pop(-1)

    if(discount == 0):
        break

    discount //= 2

    i = bisect.bisect_left(As, discount)
    As.insert(i, discount)
#    print(As)

print(sum(As))

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

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

As.sort()

#print(As)

for _ in range(M):
    discount = As.pop(-1) // 2

    i = bisect.bisect_left(As, discount)
    As.insert(i, discount)
#    print(As)

print(sum(As))

Fixed submission:
import bisect

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

As.sort()

#print(As)

for _ in range(M):
    discount = As.pop(-1)

    if(discount == 0):
        break

    discount //= 2

    i = bisect.bisect_left(As, discount)
    As.insert(i, discount)
#    print(As)

print(sum(As))

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

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

As.sort()

#print(As)

for _ in range(M):
    discount = As.pop(-1) // 2

    bisect.insort_left(As, discount)
#    print(As)

print(sum(As))

Fixed submission:
import bisect

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

As.sort()

#print(As)

for _ in range(M):
    discount = As.pop(-1)

    if(discount == 0):
        break

    discount //= 2

    i = bisect.bisect_left(As, discount)
    As.insert(i, discount)
#    print(As)

print(sum(As))
Buggy python submission (verdict: Runtime Error):
# -*- config: utg-8 -*-

n = int(input())
s = [input() for i in range(n)]

sort_list = []

for i in s:
	str_sort_list = sorted(i)
	new_str = ''.join(str_sort_list)
	sort_list.append(new_str)

count = 0
for i in sort_list[:]:
  hoge = sort_list.pop(0)
  chohuku_count = sort_list.count(hoge)
  
  count += chohuku_count
  

print(count)

Fixed submission:
# -*- config: utg-8 -*-

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

a = i[0]
b = i[1]

wa = a + b
sa = a- b
seki = a * b

print(max(wa,sa,seki))