Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import math, copy

N = int(input())

A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())

# 最後に到着する人がかかる時間を求めればよい
# 乗り物に乗れる人数 < 最終グループの人数 が成り立つときに、遅延が発生
P = [0] * 6
Q = [0] * 6
P[0] = N
Q[0] = N
counter = 0

while P[5] != N:
	# print(P)
	# print("/////////")
	counter += 1
	# それぞれのマスiについて
	for i in range(5):
		if A[i] != 0:
			if A[i] >= P[i]: # 移動できる人の数 >= 移動したい人の数
				Q[i + 1] += P[i] # iマス目にいた人をi + 1マス目に移す
				Q[i] -= P[i]
			else: # 遅延が発生
				move_num = A[i] #　このとき、次のマスに行けるのは、A[i]人だけ
				Q[i] -= A[i]
				Q[i + 1] += A[i]
	P = copy.deepcopy(Q) # 状態を更新する
		
print(counter)


Fixed submission:
import math, copy

N = int(input())

A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())

print(math.ceil(N / min(A) + 4))

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

N = int(input())

A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())

# 最後に到着する人がかかる時間を求めればよい
# 乗り物に乗れる人数 < 最終グループの人数 が成り立つときに、遅延が発生
P = [0] * 6
Q = [0] * 6
P[0] = N
Q[0] = N
counter = 0

while P[5] != N:
	# print(P)
	# print("/////////")
	counter += 1
	# それぞれのマスiについて
	for i in range(5):
		if A[i] >= P[i]: # 移動できる人の数 >= 移動したい人の数
			Q[i + 1] += P[i] # iマス目にいた人をi + 1マス目に移す
			Q[i] -= P[i]
		else: # 遅延が発生
			move_num = A[i] #　このとき、次のマスに行けるのは、A[i]人だけ
			Q[i] -= A[i]
			Q[i + 1] += A[i]
	P = copy.deepcopy(Q) # 状態を更新する
		
print(counter)


Fixed submission:
import math, copy

N = int(input())

A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())

print(math.ceil(N / min(A) + 4))
Buggy python submission (verdict: Runtime Error):
S = str(input())

if S = 'A':
  print('T')
elif S = 'G':
  print('C')
elif S = 'T':
  print('A')
else:
  print('G')

Fixed submission:
S = str(input())
 
if S == 'A':
  print('T')
elif S == 'G':
  print('C')
elif S == 'T':
  print('A')
else:
  print('G')
Buggy python submission (verdict: Runtime Error):
N, M, C = (map(int, input().split()))
B = list((map(int, input().split())))
counter = 0
for i in range(N):
	tmp = list((map(int, input().split())))
	total = C
	for j in range(M):
		total += B[i] * tmp[i]
		if total > 0:
			counter += 1
			break
			
print(counter)

Fixed submission:
N, M, C = (map(int, input().split()))
B = list(map(int, input().split()))
counter = 0
for i in range(N):
	tmp = list(map(int, input().split()))
	total = C
	for j in range(M):
		total += B[j] * tmp[j]
	if total > 0:
		counter += 1
			
print(counter)
Buggy python submission (verdict: Runtime Error):
S = list(map(int, input()))

i  = 1
counter = 0
length = len(S)
while i < length or length < 2:
	if S[i - 1] != S[i]:
		del(S[i - 1 : i + 1])
		counter += 1
		length -= 2
		i -= 1
	else:
		i += 1
		
print(counter * 2)

Fixed submission:
S = list(map(int, input()))

print(min(S.count(0), S.count(1)) * 2)

Buggy python submission (verdict: Runtime Error):
S = list(map(int, input()))

i  = 1
counter = 0
while i < len(S):
	if S[i - 1] != S[i]:
		del(S[i - 1 : i + 1])
		counter += 1
		i -= 1
	else:
		i += 1
		
print(counter * 2)

Fixed submission:
S = list(map(int, input()))

print(min(S.count(0), S.count(1)) * 2)
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    if i == 0:
        ans = A[i]
    else:
        ans = math.gcd(ans, A[i])
        
print(ans)

Fixed submission:
import fractions

N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    if i == 0:
        ans = A[i]
    else:
        ans = fractions.gcd(ans, A[i])
        
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
P = []
maximum_val = 0
maximum_index = Null

for i in range(N):
  a = int(input())
  P.append(a)
  if a > maximum_val:
    maximum_val = a
    maximum_index = i
print(sum(P) - P[maximum_index])


Fixed submission:
N = int(input())
P = []
maximum_val = 0
maximum_index = 0

for i in range(N):
	a = int(input())
	P.append(a)
	if a > maximum_val:
		maximum_val = a
		maximum_index = i
print(int(sum(P) - P[maximum_index] / 2))

Buggy python submission (verdict: Runtime Error):
N = int(input())
P = []
maximum_val = 0
maximum_index = Null

for i in range(N):
  a = int(input())
  P.append(a)
  if a > maximum:
    maximum_val = a
    maximum_index = i
print(sum(P) - P[maximum_index])

Fixed submission:
N = int(input())
P = []
maximum_val = 0
maximum_index = 0

for i in range(N):
	a = int(input())
	P.append(a)
	if a > maximum_val:
		maximum_val = a
		maximum_index = i
print(int(sum(P) - P[maximum_index] / 2))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lst = ["3", "5", "7"]
ans = 0
while lst:
    a = lst.pop(0)
    if int(a) <= N:
        for c in ["3", "5", "7"]:
            lst.append(a + c)
        if all(a.count(c) > 0 for c in ["3", "5", "7"]):
            ans += 1
            
print(ans)

Fixed submission:
N = int(input())
lst = ["3", "5", "7"]
ans = 0
while lst:
    a = lst.pop(0)
    if int(a) <= N:
        for c in ["3", "5", "7"]:
            if int(a + c) <= N:
                lst.append(a + c)
        if all(a.count(c) > 0 for c in ["3", "5", "7"]):
            ans += 1
            
print(ans)
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())

prime = [0 for _ in range(47 + 1)]
lst = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]

for i in range(2, N + 1):
	num = i
	# 素因数分解
	for p in lst:
		while True:
			if num % p == 0:
				num //= p
				prime[p] += 1
			else: break
			if num == 1: break
		

_75 = 0
_25 = 0
_15 = 0
_5 = 0
_3 = 0

for i in range(len(prime)):
	if prime[i] >= 2:
		_3 += 1
	if prime[i] >= 4:
		_5 += 1
	if prime[i] >= 14:
		_15 += 1
	if prime[i] >= 24:
		_25 += 1
	if prime[i] >= 74:
		_75 += 1
		
def comb(a, b):
	return math.factorial(a) / (math.factorial(b) * math.factorial(a - b))
		
ans = 0
ans += _75
ans += (_3 - 1) * _25 # かけられている数で1引いているのは、かける数で使っているものをかけられる数でも使う場合を除くため
ans += (_5 - 1) * _15
ans += (_3 - 2) * comb(_5, 2)

print(int(ans))

Fixed submission:
import math

N = int(input())

prime = [0 for _ in range(47 + 1)]
lst = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]

for i in range(2, N + 1):
	num = i
	# 素因数分解
	for p in lst:
		while True:
			if num % p == 0:
				num //= p
				prime[p] += 1
			else: break
			if num == 1: break
		

_75 = 0
_25 = 0
_15 = 0
_5 = 0
_3 = 0

for i in range(len(prime)):
	if prime[i] >= 2:
		_3 += 1
	if prime[i] >= 4:
		_5 += 1
	if prime[i] >= 14:
		_15 += 1
	if prime[i] >= 24:
		_25 += 1
	if prime[i] >= 74:
		_75 += 1
		
def comb(a, b):
	return math.factorial(a) / (math.factorial(b) * math.factorial(a - b))
		
ans = 0
ans += _75
ans += (_3 - 1) * _25 # かけられている数で1引いているのは、かける数で使っているものをかけられる数でも使う場合を除くため
ans += (_5 - 1) * _15
if _5 >= 2:
	ans += (_3 - 2) * comb(_5, 2)

print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
X = list(map(int, input().split()))
right, left = [], []
	
for i in range(N):
	if X[i] >= 0:
		right.append(X[i])
	else:
		left.insert(0, -X[i])
		
right.append(0)
left.append(0)
ans = float("inf")
		
for i in range(K + 1):
	if len(right) < K - i + 1 or len(left) < i + 1: continue
	tmp = min(2 * left[i - 1] + right[(K - i) - 1], left[i - 1] + 2 * right[(K - i) - 1])
	ans = min(ans, tmp)
	
print(ans)

Fixed submission:
N, K = map(int, input().split())
X = list(map(int, input().split()))
ans = float("inf")

for i in range(0, N - K + 1):
	ans = min(ans, min(abs(X[i]) + abs(X[i] - X[i + K - 1]), abs(X[i + K - 1]) + abs(X[i] - X[i + K - 1])))
	
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(map(str, input()))

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

for i in range(N):
	opposite[i] = S[0 : i].count("W") + S[i + 1 : N].count("E")
	
print(min(opposite))

Fixed submission:
N = int(input())
S = list(map(str, input()))
ret = float("inf")
west = [0 for _ in range(N + 2)]
east = [0 for _ in range(N + 2)]

for i in range(1, N + 1):
	if S[i - 1] == "W":
		west[i] = west[i - 1] + 1
	else:
		west[i] = west[i - 1]
for i in range(N, 0, -1):
	if S[i - 1] == "E":
		east[i] = east[i + 1] + 1
	else:
		east[i] = east[i + 1]
	ret = min(east[i] + west[i] - 1, ret)

print(ret)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(map(str, input()))

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

for i in range(N):
	if S[i] == "E":
		for j in range(0, i):
			opposite[j] += 1
	else:
		for j in range(i + 1, N):
			opposite[j] += 1
print(min(opposite))

Fixed submission:
N = int(input())
S = list(map(str, input()))
ret = float("inf")
west = [0 for _ in range(N + 2)]
east = [0 for _ in range(N + 2)]

for i in range(1, N + 1):
	if S[i - 1] == "W":
		west[i] = west[i - 1] + 1
	else:
		west[i] = west[i - 1]
for i in range(N, 0, -1):
	if S[i - 1] == "E":
		east[i] = east[i + 1] + 1
	else:
		east[i] = east[i + 1]
	ret = min(east[i] + west[i] - 1, ret)

print(ret)
Buggy python submission (verdict: Runtime Error):
from scipy.misc import comb
N = int(input())
A = sorted(list(map(int, input().split())), reverse = True)

if N == 2:
	print(A[0], A[1])
else:
	q = max(A)
	B = list(map(lambda x : abs(q // 2 - x),  A))
	print(q, A[B.index(min(B))])

Fixed submission:
N = int(input())
A = sorted(list(map(int, input().split())), reverse = True)

if N == 2:
	print(A[0], A[1])
else:
	q = max(A)
	B = list(map(lambda x : abs(q // 2 - x),  A))
	print(q, A[B.index(min(B))])

Buggy python submission (verdict: Runtime Error):
from scipy.special import comb
N = int(input())
A = sorted(list(map(int, input().split())), reverse = True)

if N == 2:
	print(A[0], A[1])
else:
	q = max(A)
	B = list(map(lambda x : abs(q // 2 - x),  A))
	print(q, A[B.index(min(B))])

Fixed submission:
N = int(input())
A = sorted(list(map(int, input().split())), reverse = True)

if N == 2:
	print(A[0], A[1])
else:
	q = max(A)
	B = list(map(lambda x : abs(q // 2 - x),  A))
	print(q, A[B.index(min(B))])
Buggy python submission (verdict: Runtime Error):
S = sorted(list(map(str, input())))
T = sorted(list(map(str, input())), reverse = True)
len = min(len(S), len(T))

flg = 2

for i in range(len):
	if S[i] < T[i]:
		flg = 1
		break
	elif S[i] > T[i]:
		flg = 0
		break

if flg == 1:		
	print("Yes")
elif flg == 0:
	print("No")
else:
	if len(S) < len(T):
		print("Yes")
	else:
		print("No")

Fixed submission:
S = sorted(list(map(str, input())))
T = sorted(list(map(str, input())), reverse = True)
length = min(len(S), len(T))

flg = 2

for i in range(length):
	if S[i] < T[i]:
		flg = 1
		break
	elif S[i] > T[i]:
		flg = 0
		break

if flg == 1:		
	print("Yes")
elif flg == 0:
	print("No")
else:
	if len(S) < len(T):
		print("Yes")
	else:
		print("No")

Buggy python submission (verdict: Runtime Error):
S = sorted(list(map(str, input())))
T = sorted(list(map(str, input())), reverse = True)
len = min(len(S), len(T))

print(S, T)
flg = 2

for i in range(len):
	if S[i] < T[i]:
		flg = 1
		break
	elif S[i] > T[i]:
		flg = 0
		break

if flg == 1:		
	print("Yes")
elif flg == 0:
	print("No")
else:
	if len(S) <= len(T):
		print("Yes")
	else:
		print("No")

Fixed submission:
S = sorted(list(map(str, input())))
T = sorted(list(map(str, input())), reverse = True)
length = min(len(S), len(T))

flg = 2

for i in range(length):
	if S[i] < T[i]:
		flg = 1
		break
	elif S[i] > T[i]:
		flg = 0
		break

if flg == 1:		
	print("Yes")
elif flg == 0:
	print("No")
else:
	if len(S) < len(T):
		print("Yes")
	else:
		print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
ctr= [0 for _ in range(N)]

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

# A固定
cur = 0

for i in range(N):
	for j in range(cur, N):
		if B[i] < C[j]:
			ctr[i] += N - j
			cur = j
			break
			
cur = 0
ans = 0
for i in reversed(range(1, N)):
	ctr[i - 1] += ctr[i]
for i in range(N):
	for j in range(cur, N):
		if A[i] < B[j]:
			ans += ctr[j]
			cur = j
			break
			
print(ans)

Fixed submission:
import bisect

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
ctr= [0 for _ in range(N)]

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

ans = 0

for i in range(N):
	insert_index_A = bisect.bisect_left(A, B[i])
	insert_index_C = N - bisect.bisect_right(C, B[i])
	ans += insert_index_A * insert_index_C
	
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
ctr= [0 for _ in range(N)]

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

# A固定
cur = 0

for i in range(N):
	for j in range(cur, N):
		if B[i] < C[j]:
			ctr[i] += N - j
			cur = j
			break
			
cur = 0
ans = 0
for i in reversed(range(1, N)):
	ctr[i - 1] += ctr[i]
for i in range(N):
	for j in range(cur, N):
		if A[i] < B[j]:
			ans += ctr[j]
			break
			
print(ans)

Fixed submission:
import bisect

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
ctr= [0 for _ in range(N)]

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

ans = 0

for i in range(N):
	insert_index_A = bisect.bisect_left(A, B[i])
	insert_index_C = N - bisect.bisect_right(C, B[i])
	ans += insert_index_A * insert_index_C
	
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
T = []

for _ in range(N):
	T.append(int(input()))
	
def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

ans = 1
	
for i in range(N):
	ret = ret * T[i] // gcd(ret, T[i])
	
print(ans)

Fixed submission:
N = int(input())
T = []

for _ in range(N):
	T.append(int(input()))
	
def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

ans = 1
	
for i in range(N):
	ans = ans * T[i] // gcd(ans, T[i])
	
print(ans)

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

for _ in range(N):
	T.append(int(input()))
	
def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

ans = 1
	
for i in range(N):
	ret = ret * T[i] // gcd(ret, T[i]])
	
print(ans)

Fixed submission:
N = int(input())
T = []

for _ in range(N):
	T.append(int(input()))
	
def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

ans = 1
	
for i in range(N):
	ans = ans * T[i] // gcd(ans, T[i])
	
print(ans)

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

for _ in range(N):
	T.append(int(input()))
	
def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

ans = 1
	
while T:
	cur = T.pop(0)
	ans = (ans * cur) / gcd(ans, cur)
	
print(int(ans))

Fixed submission:
N = int(input())
T = []

for _ in range(N):
	T.append(int(input()))
	
def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

ans = 1
	
for i in range(N):
	ans = ans * T[i] // gcd(ans, T[i])
	
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
from_1 = []
to_N = []

for i in range(M):
    a, b = map(int, input().split())
    if a == 1:
        from_1.append(b)
    elif b == N:
        to_N.append(a)
        
from_1.sort()
to_N.sort()
flg = 0

for i in range(len(from_1)):
    if from_1[i] in to_N:
        flg = 1
        break
        
if flg:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Fixed submission:
N, M = map(int, input().split())
lst = []

for i in range(M):
    a, b = map(int, input().split())
    if a == 1:
        lst.append(b)
    elif b == N:
        lst.append(a)
        
lst.sort()
flg = 0

for i in range(len(lst) - 1):
    if lst[i] == lst[i + 1]:
        flg = 1
        break
        
if flg:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
a, p, b = map(int, input().split())

if p == "+":
  print(a + b)
else:
  print(a - b)

Fixed submission:
a, p, b = map(str, input().split())
a = int(a)
b = int(b)

if p == "+":
  print(a + b)
else:
  print(a - b)
Buggy python submission (verdict: Runtime Error):
import copy
N, M = map(int, input().split())
XY = []
for _ in range(M):
    x, y = map(int, input().split())
    XY.append([x - 1, y - 1])

ans = [0] * N

def dfs(depth, lst):
    if depth == M:
        for i in range(N):
            if lst[i][0] == 1:
                global ans
                ans[i] = 1
                return 0
    start = XY[depth][0]
    goal = XY[depth][1]
    # print(start, goal)
    # print(lst)
    if lst[start][0] == 1 and lst[start][1] == 0:
        lst[start][0] -= 1
        lst[goal][0] += 1
        dfs(depth + 1, lst)
    elif lst[start][0] == 1 and lst[start][1] > 0:
        a = copy.deepcopy(lst)
        lst[start][0] -= 1
        lst[goal][0] += 1
        dfs(depth + 1, lst)

        a[start][1] -= 1
        a[goal][1] += 1
        dfs(depth + 1, a)
    elif lst[start][0] == 0 and lst[start][1] == 0: return 0
    else:
        lst[start][1] -= 1
        lst[goal][1] += 1
        dfs(depth + 1, lst)

tmp = [[0, 1] for _ in range(N)]
tmp[0] = [1, 0]
dfs(0, tmp)

print(sum(ans))

Fixed submission:
import copy
N, M = map(int, input().split())
XY = []
for _ in range(M):
    x, y = map(int, input().split())
    XY.append([x - 1, y - 1])

ball_num = [1] * N
is_red = [False] * N
is_red[0] = True

for i in range(M):
    s = XY[i][0]
    g = XY[i][1]
    if is_red[s]:
        if ball_num[s] == 1:
            ball_num[s] -= 1
            ball_num[g] += 1
            is_red[s] = False
            is_red[g] = True
        else:
            ball_num[s] -= 1
            ball_num[g] += 1
            is_red[g] = True
    else:
        ball_num[s] -= 1
        ball_num[g] += 1

print(sum(is_red))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(x) for x in input().split()]
ans = 'YES' 
for i in range(N):
    if A.count(A[i]) > 1:
        ans = 'NO'
        break
print(ans)


Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
A.sort()

ans = 'YES'

for i in range(N-1):
    if A[i] == A[i+1]:
        ans = 'NO'
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
from itertools import accumulate
n, k = map(int, input().split())
l = list(map(int, input().split()))
l = list(map(lambda x: (((x + 1) * x) / 2) / x, l))
s = list(accumulate(l))
l_2 = [s[k - 1]]
for i in range(len(l) - (k - 1) - 1):
    l_2 += [s[i + k] - s[i]]
print(max(l_2)

Fixed submission:
from itertools import accumulate
n,k=map(int, input().split())
A=[((int(i)*(int(i)+1))/2)/int(i) for i in input().split()]
al = list(accumulate(A))
ans = al[k-1]
for i in range(k, n):ans=max(ans, al[i]-al[i-k])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
l = [int(x) for x in input().split()]
N = l[0]
K = l[1]
P = [int(x) for x in input().split()]

expected = []
a = 0
ans = []

for i in range(len(P)):
    expected.append((P[i]+1)/2)
#print(expected)

for k in range(N - K + 1):
    a = 0
    for x in range(K):
        a += expected[k+x]
    ans.append(a)
#print(ans)
print(max(ans))

Fixed submission:
from itertools import accumulate
n,k=map(int, input().split())
A=[((int(i)*(int(i)+1))/2)/int(i) for i in input().split()]
al = list(accumulate(A))
ans = al[k-1]
for i in range(k, n):ans=max(ans, al[i]-al[i-k])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
l = [int(x) for x in input().split()]
N = l[0]
K = l[1]
P = [int(x) for x in input().split()]

expected = []
a = 0
ans = []

for i in range(len(P)):
    a = 0
    for j in range(P[i]):
        a += ((j+1)/P[i])
    expected.append(a)
#print(expected)

for k in range(N - K + 1):
    a = 0
    for x in range(K):
        a += expected[k+x]
    ans.append(a)
#print(ans)
print(max(ans))


Fixed submission:
from itertools import accumulate
n,k=map(int, input().split())
A=[((int(i)*(int(i)+1))/2)/int(i) for i in input().split()]
al = list(accumulate(A))
ans = al[k-1]
for i in range(k, n):ans=max(ans, al[i]-al[i-k])
print(ans)
Buggy python submission (verdict: Runtime Error):
l  = [int(x) for x in input().split()]
a, b = l[0], l[1]
if a <= b:
    print(int(str(b)*a))
else:
    print(int(str(a)*b))

Fixed submission:
l  = [int(x) for x in input().split()]
if l[0]==l[1]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
c = input()
if c == a or c == i or c == u or c ==e or c == o:
    print('vowel')
else:
    print('consonant')

Fixed submission:
c = input()
if c == 'a' or c == 'i' or c == 'u' or c == 'e' or c == 'o':
    print('vowel')
else:
    print('consonant')
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = map(int, input().split())
flag = "APPROVED"

for i in m:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
    		flag = "DENIED"
    
print(flag)


Fixed submission:
n = int(input())
m = map(int, input().split())
flag = "APPROVED"

for i in m:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
			flag = "DENIED"
    
print(flag)
Buggy python submission (verdict: Time Limit Exceeded):
# B
n = int(input())
a = list(map(int, input().split()))

ans = 1
for i in range(n):
    ans *= a[i]
    
if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
# B  => TLE
n = int(input())
a = list(map(int, input().split()))

ans = 1
if a.count(0) > 0:
    ans = 0
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            ans = -1
            break
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# C
k = int(input())

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

ans = 0
for a in range(1, k+1):
    for b in range(1, k+1):
        for c in range(1, k+1):
            ans += gcd(a, gcd(b, c))
            
print(ans)

Fixed submission:
from  math import gcd
 
 
k = int(input())
sum_c = 0
 
for a in range(1, k + 1):
    for b in range(1, k + 1):
        for c in range(1, k + 1):
            sum_c += gcd(gcd(a, b), c)
            
print(sum_c)
Buggy python submission (verdict: Runtime Error):
# C
# 解説みた
a, b, c = map(int, input().split())

if 4*a*b < (c - a - b)**(1/2) and 0 < c - a - b: 
    print('Yes')
else:
    print('No')

Fixed submission:
# C
# 解説みた
a, b, c = map(int, input().split())

if 4*a*b < (c - a - b)**2 and 0 < c - a - b: 
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
# A 
s = input()

for i in range(0, len(s), 2):
    if len(s) < 2:
        bool = False
        break
    elif s[i] == 'h' and s[i+1] == 'i':
        bool = True
    else:
        bool = False
        break
        
print('Yes' if bool else 'No')

Fixed submission:
# A 
s = input()

for i in range(0, len(s), 2):
    if len(s)%2 == 1:
        bool = False
        break
    elif s[i] == 'h' and s[i+1] == 'i':
        bool = True
    else:
        bool = False
        break
        
print('Yes' if bool else 'No')

Buggy python submission (verdict: Runtime Error):
# A
s = input()

for i in range(0, len(s), 2):
    if s[i] == 'h' and s[i+1] == 'i':
        bool = True
    else:
        bool = False
        break
        
print('Yes' if bool else 'No')

Fixed submission:
# A 
s = input()

for i in range(0, len(s), 2):
    if len(s)%2 == 1:
        bool = False
        break
    elif s[i] == 'h' and s[i+1] == 'i':
        bool = True
    else:
        bool = False
        break
        
print('Yes' if bool else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
# D
s = input()
q = int(input())
for i in range(q):
    try:
        n, f, c = map(str, input().split())
    except ValueError:
        s = s[::-1]
        n = '1'
    if int(n) == 2:
        if int(f) == 1:
            s = c + s
        elif int(f) == 2:
            s = s + c
            
print(s)

Fixed submission:
# D
# maspyの解答
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import deque
 
S = deque(readline().rstrip().decode())
Q = int(readline())
query = readlines()
 
rev = False
for q in query:
    if q[0] == ord('1'):
        rev = not rev
    else:
        _, f, c = q.decode().split()
        f = int(f)
        if rev ^ (f == 1):
            S.appendleft(c)
        else:
            S.append(c)
 
T = ''.join(S)
if rev:
    T = T[::-1]
print(T)