Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
count = 0

for j in range(n):
  if a[j]%2 == 0:
    arr = []
    temp = a[j]
    for i in range(2, int(-(-a[j]**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([a[j], 1])
        
    count = count + arr[0][1]
    
print(count)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 0

for i in range(n):
  count = 0
  temp = a[i]
  while (temp%2 == 0):
    temp = temp//2
    count = count + 1
    
  ans = ans + count
  
print(ans)

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())
a = list(map(int,input().split()))
count = 0

for i in range(n):
  if a[i]%2 == 0:
    temp = factorization(a[i])
    count = count + temp[0][1]
    
print(count)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 0

for i in range(n):
  count = 0
  temp = a[i]
  while (temp%2 == 0):
    temp = temp//2
    count = count + 1
    
  ans = ans + count
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import copy

n = int(input())
x = list(map(int,input().split()))
base = copy.deepcopy(x)
base_1 = copy.deepcopy(x)
base.sort()
base_1.sort()

for i in range(n):
  a_l = base.index(x[i])
  a_u = base_1.index(x[i])
  
  if a_l == (n-1)-a_u:
    if n//2 > a_l:
      ans = base[n//2]
    elif n//2 <= a_l:
      ans = base[n//2-1]
      
  else:
    if (a_l <= n//2-1) and (n//2 <= a_u):
      ans = base[a_l]
    elif a_u <= n//2 - 1:
      ans = base[n//2]
    elif n//2 <= a_l:
      ans = base[n//2 - 1]
      
  print(ans)

Fixed submission:
import copy

n = int(input())
x = list(map(int,input().split()))
key = {}
base = copy.deepcopy(x)
base.sort()

for i in range(n):

  if n//2 > i:
    ans = base[n//2]
  elif n//2 <= i:
    ans = base[n//2-1]
   
  if not ("key" + str(base[i]) in key):
    key["key" + str(base[i])] = ans
    
for i in range(n):
  print(key["key" + str(x[i])])
Buggy python submission (verdict: Runtime Error):
import queue
import numpy as np

num = list(map(int,input().split()))
field = [list(input()) for i in range(num[0])]
seen = np.zeros((num[0],num[1]))

step_r = [1,0,-1,0]
step_c = [0,1,0,-1]
q_r = queue.Queue()
q_c = queue.Queue()
sign = 0
white = 0
q_r.put(0)
q_c.put(0)

for i in range(num[0]):
  for j in range(num[1]):
    if field[i][j] == ".":
      white = white + 1

while not q_r.empty():
  r = q_r.get()
  c = q_c.get()
  for i in range(4):
    next_r = r + step_r[i]
    next_c = c + step_c[i]
    
    if (next_r<0) or (num[0]<=next_r) or (next_c<0) or (num[1]<=next_c) or (field[next_r][next_c] == "#"):
      continue
      
    if seen[next_r][next_c] == 0:
      q_r.put(next_r)
      q_c.put(next_c)
      seen[next_r][next_c] = seen[r][c] + 1
      if (next_r == num[0]-1) and (next_c == num[1]-1):
        g_r = next_r
        g_c = next_c
        sign = 1
        break
 
  if sign == 1:
    break
    
ans = white - (seen[g_r][g_c] + 1)
print(int(ans))

Fixed submission:
import queue
import numpy as np

num = list(map(int,input().split()))
field = [list(input()) for i in range(num[0])]
seen = np.zeros((num[0],num[1]))

step_r = [1,0,-1,0]
step_c = [0,1,0,-1]
q_r = queue.Queue()
q_c = queue.Queue()
sign = 0
white = 0
q_r.put(0)
q_c.put(0)

for i in range(num[0]):
  for j in range(num[1]):
    if field[i][j] == ".":
      white = white + 1

while not q_r.empty():
  r = q_r.get()
  c = q_c.get()
  for i in range(4):
    next_r = r + step_r[i]
    next_c = c + step_c[i]
    
    if (next_r<0) or (num[0]<=next_r) or (next_c<0) or (num[1]<=next_c) or (field[next_r][next_c] == "#"):
      continue
      
    if seen[next_r][next_c] == 0:
      q_r.put(next_r)
      q_c.put(next_c)
      seen[next_r][next_c] = seen[r][c] + 1
      if (next_r == num[0]-1) and (next_c == num[1]-1):
        g_r = next_r
        g_c = next_c
        sign = 1
        break
 
  if sign == 1:
    break

if sign == 1:
  ans = white - (seen[g_r][g_c] + 1)
elif sign == 0:
  ans = -1

print(int(ans))
Buggy python submission (verdict: Runtime Error):

#a a <A
#b b <B
#c K-a-b <C 
if K < A:
    ans=K
elif K-A <= B and K>=A:
    ans=A
else :
    ans=A-(K-A-B)
print(ans)

Fixed submission:
A,B,C,K=map(int,input().split())
#print(A,B,C,K)
#a a <A
#b b <B
#c K-a-b <C 
if K < A:
    ans=K
elif K-A <= B and K>=A:
    ans=A
else :
    ans=A-(K-A-B)
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
H=list(map(int,input().split()))
ABmap=[[] for i in range(N)]
count=0
for i in range(M):
    A,B=map(lambda x:x-1,map(int,input().split()))
    ABmap[A].append(H[B])
    ABmap[B].append(H[A])
        
for i in range(N):
    #print(ABmap[i])
    #print(ABmap.count(H[i]))
    if max(ABmap[i])<H[i]:
        count+=1
print(count)
        
    

Fixed submission:
S=input()
T=""
if S=="ARC":
   T="ABC"
else: T="ARC"
print(T)

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
H=list(map(int,input().split()))
ABmap=[[0 for i in range(N)] for i in range(N)]
count=0
for i in range(M):
    A,B=map(lambda x:x-1,map(int,input().split()))
    ABmap[A][B]=H[B]
    ABmap[B][A]=H[A]
        
for i in range(N):
    #print(ABmap[i])
    #print(ABmap.count(H[i]))
    if max(ABmap[i])<H[i]:
        count+=1
print(count)
        
    

Fixed submission:
S=input()
T=""
if S=="ARC":
   T="ABC"
else: T="ARC"
print(T)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

A=[]
A=list(map(int,input().split()))
for i in range(1,N+1):
    print(A.count(i))


Fixed submission:
N=int(input())
Acount=[0 for i in range(N)]
A=list(map(int,input().split()))
for i in range(N-1):
    Acount[A[i]-1]+=1
for i in range(N):
    print(Acount[i])
Buggy python submission (verdict: Runtime Error):
A,B,C,K = map(int,input().split())
if A + B >= K:
	print(max(K.A))
else:
	print(A-(K-(A+B)))

Fixed submission:
A,B,C,K = map(int,input().split())
if A + B >= K:
	print(min(K,A))
else:
	print(A-(K-(A+B)))
Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
C = 0
for i in range(-10000,10000):
	if C == 1:
		break
	for j in range(-10000,10000):
		if i**5-j**5 == X:
			print(i,j)
			C += 1
			break

Fixed submission:
X = int(input())
C = 0
for i in range(-1000,1000):
	if C == 1:
		break
	for j in range(-1000,1000):
		if i**5-j**5 == X:
			print(i,j)
			C += 1
			break
Buggy python submission (verdict: Runtime Error):
N,A,B = map(int,input().split())

Line1 = ("b"*A+"r"*B)
Line2 = ("b"*A+"r"*B)
Cnt = 0
while Cnt < N/(A+B):
	Line2 += Line1
	Cnt += 1

print(Line2[:N].count("b"))


Fixed submission:
S = input()
if S == "AAA" or S == "BBB":
	print("No")
else:
	print("Yes")

Buggy python submission (verdict: Runtime Error):
N,A,B = map(int,input().split())
One_line = ""
Line = ("b"*A+"r"*B)
Cnt = 0
while Cnt < N:
	One_line += Line
	Cnt += (A + B)

print(One_line[:N].count("b"))


Fixed submission:
S = input()
if S == "AAA" or S == "BBB":
	print("No")
else:
	print("Yes")
Buggy python submission (verdict: Runtime Error):
N=input()
R=input()
Naibu = int(R) + 100*(10-int(N))
if int(N)<=9:
    print(Naibu)
else:
    print(R)

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

Naibu = int(N[1]) + 100*(10-int(N[0]))
if int(N[0])<=9:
    print(Naibu)
else:
    print(N[1])
Buggy python submission (verdict: Runtime Error):
N=input().split
if N[0] != N[1] and N[0] != N[2] and N[1] != N[2]:
  print("No")
elif N[0] == N[1] and N[0] == N[2] and N[1] == N[2]:
  print("No") 
else:
  print("Yes")

Fixed submission:
N=input().split()
if N[0] != N[1] and N[0] != N[2] and N[1] != N[2]:
  print("No")
elif N[0] == N[1] and N[0] == N[2] and N[1] == N[2]:
  print("No") 
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
Week=["SAT","FRI","THU","WED","TUE","MON","SUN"]
 Day=input()
 print(Week.index(Day)+1)

Fixed submission:
N = input()
if N == "SUN":
    print(7)
elif N == "MON":
    print(6)
elif N == "TUE":
    print(5)
elif N == "WED":
    print(4)
elif N == "THU":
    print(3)
elif N == "FRI":
    print(2)
elif N == "SAT":
    print(1)

Buggy python submission (verdict: Runtime Error):
Week=["SAT","FRI","THU","WED","TUE","MON","SAN"]
Day=input()
print(Week.index(Day)+1)

Fixed submission:
N = input()
if N == "SUN":
    print(7)
elif N == "MON":
    print(6)
elif N == "TUE":
    print(5)
elif N == "WED":
    print(4)
elif N == "THU":
    print(3)
elif N == "FRI":
    print(2)
elif N == "SAT":
    print(1)
Buggy python submission (verdict: Runtime Error):
R = input()R = input()
print(int(R)*int(R))

Fixed submission:
R = input()
print(int(R)*int(R))
Buggy python submission (verdict: Runtime Error):
W = ["Sunny","Cloudy","Rainy"]
M = input()
print(W[W.index(M)+1])

Fixed submission:
W = ["Sunny","Cloudy","Rainy","Sunny"]
M = input()
print(W[W.index(M)+1])
Buggy python submission (verdict: Runtime Error):
S = input().split()
T = input().split()
C = 0
for i in range(3):
    if S[i] == T[i]:
        C += 1
print(C)

Fixed submission:
S = input()
T = input()
C = 0
for i in range(len(S)):
    if S[i] == T[i]:
        C += 1
print(C)

Buggy python submission (verdict: Runtime Error):
S,T = input().split()
C = 0
for i in range(len(S)):
    if S[i] == T[i]:
        C += 1
print(C)

Fixed submission:
S = input()
T = input()
C = 0
for i in range(len(S)):
    if S[i] == T[i]:
        C += 1
print(C)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
A = int((a+b)/2)
print(A if ((a+b)%2 == 0 else int(A+0.5))

Fixed submission:
a,b = map(int,input().split())
print((a+b-1)//2+1)

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
A = int((a+b)/2)
print(A if (A%2 == 0 else int(A+0.5))

Fixed submission:
a,b = map(int,input().split())
print((a+b-1)//2+1)
Buggy python submission (verdict: Time Limit Exceeded):
''' Hey stalker :) '''
INF = 10**10
def main():
    #print = out.append
    ''' Cook your dish here! '''
    n, k = get_list()
    li = get_list()
    ans = 0
    for i in range(n-k+1):
        ans = max(ans, sum(li[i:i+k]))
    print((ans+k)/2)



''' Pythonista fLite 1.1 '''
import sys
from collections import defaultdict, Counter
from bisect import bisect_left, bisect_right
#from functools import reduce
import math
#input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()
#[main() for _ in range(int(input()))]
print(*out, sep='\n')


Fixed submission:
''' Hey stalker :) '''
INF = 10**10
def main():
    print = out.append
    ''' Cook your dish here! '''
    n, k = get_list()
    li = get_list()
    ans = sum(li[:k])
    sm = ans
    for i in range(n-k+1):
        ans = max(ans, sm)
        if i<n-k:
            sm += li[i + k] - li[i]
    print((ans+k)/2)



''' Pythonista fLite 1.1 '''
import sys
from collections import defaultdict, Counter
from bisect import bisect_left, bisect_right
#from functools import reduce
import math
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()
#[main() for _ in range(int(input()))]
print(*out, sep='\n')
Buggy python submission (verdict: Runtime Error):
def main():
    #print = out.append
    ''' Cook your dish here! '''
    n = get_int()
    print("?", " ".join(map(str, range(1, 1 + n))), flush=True)
    start = input()
    ptr = 0
    res = ['' for _ in range(2*n)]
    for i in range(2, n+2):
        print("?", " ".join(map(str, range(i, i+n))), flush=True)
        cr = input()
        ptr += 1
        if cr!=start:
            res[ptr-1] = start[0]
            res[ptr + n - 1] = 'R' if res[ptr-1]!='R' else 'B'
            break
    outer = list(range(1, ptr)) + list(range(ptr+n+1, (2*n)+1))
    inner = list(range(ptr+1, ptr + n))
    for i in outer:
        print("?", i, " ".join(map(str, inner)), flush=True)
        res[i-1] = input()[0]
    for i in inner:
        print("?", i, " ".join(map(str, outer)), flush=True)
        res[i-1] = input()[0]
    print("!", "".join(res), flush=True)


''' Coded with love at India by Satyam Kumar '''
import sys
#from collections import defaultdict
import math
#input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()
#[main() for _ in range(int(input()))]
#print(*out, sep='\n')


Fixed submission:
def main():
    #print = out.append
    ''' Cook your dish here! '''
    x, y = get_list()
    res = 100000 * (4-x) if x<=3 else 0
    res += 100000 * (4-y) if y<=3 else 0
    if x==1 and y==1: res += 400000
    print(res)


''' Coded with love at India by Satyam Kumar '''
import sys
#from collections import defaultdict
import math
#input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()
#[main() for _ in range(int(input()))]
print(*out, sep='\n')
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
x = [int(i) for i in input().split()]
mul=1
check=10**18
for i in range(n):
    mul*=int(x[i])
if(check<mul):
    print("-1")
else:
    print(mul)

Fixed submission:
n=int(input())
x = [int(i) for i in input().split()]
mul=1
check=10**18
count=x.count(0)
if(count>=1):
    print("0")
else:
    for i in range(n):
        mul*=int(x[i])
        if(check<mul):
            break
    if(check<mul):
        print("-1")
    else:
        print(mul)
Buggy python submission (verdict: Runtime Error):
N =input()
print(int(N+1)/2)

Fixed submission:
N = input()
print(int((int(N)+1)/2))

Buggy python submission (verdict: Runtime Error):
N = input()
print(N/2)

Fixed submission:
N = input()
print(int((int(N)+1)/2))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
arr = list(map(int, input().split(' ')))
ans = 1
for i in arr:
  ans = ans * i
if ans > 1e18:
  print(-1)
else:
  print(ans)

Fixed submission:
def f():
    n = int(input())
    x = int(1e18)
    arr = list(map(int, input().split(' ')))
    arr.sort()
    ans = 1
    for i in arr:
        # print(i)
        ans = ans * i
        if ans > x:
            print(-1)
            return
    print(ans)
f()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

N = int(input())
A = [int(_) for _ in input().split()]

A_n = [a + b + 1 for a, b in enumerate(A)]

ret = 0
for n in range(len(A)):
    #print(A_n[:n], n + 1 - A[n])
    ret += A_n[:n].count(n + 1 - A[n])
print(ret)


Fixed submission:
#!/usr/bin/env python3

import numpy as np

N = int(input())
A = [int(_) for _ in input().split()]

# A_n = [a + b + 1 for a, b in enumerate(A)]

# ret = 0
# for n in range(len(A)):
#     #print(A_n[:n], n + 1 - A[n])
#     ret += A_n[:n].count(n + 1 - A[n])
# print(ret)

nmax = int(2e5 + 1)
X = [0] * nmax
Y = [0] * nmax
for n, a in enumerate(A):
    x = n - a
    y = n + a
    if x >= 0 and x < nmax:
        X[x] += 1
    if y >= 0 and y < nmax:
        Y[y] += 1
ret = 0
for x, y in zip(X, Y):
    ret += x * y
print(ret)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python

from sys import stdin
from math import ceil

N, M = (int(wd) for wd in stdin.readline().split())
a = [int(wd) for wd in stdin.readline().split()]

def kouyakusuu(g1, g2):
    if g1 == 0 or g2 == 0:
        return g1
    return kouyakusuu(g2, g1 % g2)

def jouyo(g1, g2):
    M1, P1 = g1
    M2, P2 = g2
    if M1 < M2:
        M1, M2 = M2, M1
        P1, P2 = P2, P1
    ret = P1
    for _ in range(M2):
        if ret % M2 == P2:
            break
        ret += M1
        pass
    if ret % M2 != P2:
        return None
    return (M1 * M2 / kouyakusuu(M1, M2), ret)

cur = (a[0], a[0] // 2)
for aa in a[1:]:
    cur = jouyo(cur, (aa, aa//2))
    if cur is None:
        break
if cur is None:
    print(0)
else:
    print(int(ceil((M - cur[1]) / cur[0] + 1)))


Fixed submission:
#!/usr/bin/env python

from sys import stdin
from math import floor

N, M = (int(wd) for wd in stdin.readline().split())
a = [int(wd) for wd in stdin.readline().split()]

def kouyakusuu(g1, g2):
    if g1 < g2:
        return kouyakusuu(g2, g1)
    if g2 == 0:
        return g1
    return kouyakusuu(g2, g1 % g2)

def koubaisuu(g1, g2):
    return (g1 * g2) // kouyakusuu(g1, g2)




def solve2(N, M, a):
    ret = 1
    cnt2 = 1
    while a[0] % (2**cnt2) == 0: cnt2 += 1
    ng = 2 ** cnt2
    cnt2 -= 1
    ok = 2 ** cnt2
    for aa in a:
        if aa % ng == 0:
            return 0
        if aa % ok != 0:
            return 0
        ret = koubaisuu(ret, aa // 2)
    return int(floor((M - ret) / (ret * 2)) + 1)

print(solve2(N, M, a))
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
 
 
long long LIMIT = 1000000000000000000;
 
int main(){
  int n;
  cin >> n;
  vector<long long> vec(n);
  
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  
  if ( std::find(vec.begin(), vec.end(), 0) != vec.end() ) {
    cout << 0 << endl;
    return 0;
  }
  
  long long products = 1;
  for (int i = 0; i < n; i++) {
    products *= vec.at(i);
	if(products > LIMIT) {
      cout << -1 << endl;
      return 0;
    }
  }
  
  cout << products << endl;
  
  return 0;

Fixed submission:

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

def main():
  if(0 in A):
    print(0)
    return

  products = 1
  for a in A:
    products *= a
    if(products > 1000000000000000000):
      print(-1)
      return
  print(products)
  return

main()
Buggy python submission (verdict: Runtime Error):
3
28 27 24

Fixed submission:
N = input()
A = map(int, input().split())
def main():
  for a in A:
    if a%2 == 0:
      if a%3 != 0 and a%5 != 0:
        print('DENIED')
        return
  print('APPROVED')
  return

main()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = [sorted(input()) for _ in range(N)]

def isAnagram(s1, s2):
  return 1 if s1 == s2 else 0

print( sum([sum( [isAnagram(s[i], s[j])for j in range(i+1, N)]) for i in range(N)]) )
  

Fixed submission:
from collections import defaultdict
import math

N = int(input())
s = [str(sorted(input())) for _ in range(N)]
rl_s = defaultdict(int)
for _s in s:
  rl_s[_s] += 1

c = 0
for v in rl_s.values():
  c += sum([i for i in range(v)])
print( c )
Buggy python submission (verdict: Runtime Error):
n = int(input())
c=0
for r in [i+1 for in range(len(str(n))) if i%2==1]:
  for i in range(10**(r-1), min(n+1, 10**r)):
    c++n
print(c)

Fixed submission:
n = int(input())
c=0
for r in [i+1 for i in range(0, len(str(n))) if i%2==0]:
  for i in range(10**(r-1), min(n+1, 10**r)):
    c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map( int, input().split()))
def solve():
  for i in range(N-1, 0, -1):
    if H[i-1]-H[i]>1>
    return False
  return True

print('Yes' if solve() else 'No')

Fixed submission:
N = int(input())
H = list(map( int, input().split()))
def solve():
  for i in range(N-1, 0, -1):
    if H[i-1]-H[i]>1:
      return False
    if H[i-1]-H[i]==1:
      H[i-1]-=1
  return True

print('Yes' if solve() else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = [int(input()) for _ in range(n)]
for i in range(n):
  print(max(A[:i] + A[i+1:]))

Fixed submission:
n = int(input())
A = [int(input()) for _ in range(n)]
max_num, second_num = sorted(A, reverse=True)[:2]

for a in A:
  if a==max_num: print(second_num)
  else: print(max_num)
Buggy python submission (verdict: Runtime Error):
A = int(input())
print(180*(n-2))

Fixed submission:
n = int(input())
print(180*(n-2))
Buggy python submission (verdict: Runtime Error):
N = int(input())
cost = [int(c)-int(v) for c,v in zip(input(), input())]
print(sum([c if c>0 else 0 for c in cost]))

Fixed submission:
N = int(input())
cost = [int(c)-int(v) for c,v in zip(input().split(), input().split())]
print(sum([c if c>0 else 0 for c in cost]))
Buggy python submission (verdict: Time Limit Exceeded):
A = sorted( [input()[::-1] for i in range(5)] )
while (A[0][0] == "0"):
  tmp = A.pop(0)
  A.append(tmp)

A = [int(a[::-1]) for a in A][::-1]

def roundUp(n):
  return n if n%10==0 else n + (10-n%10)

print(sum([roundUp(A[i]) for i in range(4)]) + A[4])


Fixed submission:
A = sorted( [input()[::-1] for i in range(5)] )
c = 0
while (A[0][0] == "0" and c<5):
  tmp = A.pop(0)
  A.append(tmp)
  c+=1

A = [int(a[::-1]) for a in A][::-1]

def roundUp(n):
  return n if n%10==0 else n + (10-n%10)

print(sum([roundUp(A[i]) for i in range(4)]) + A[4])
Buggy python submission (verdict: Runtime Error):
b = input()
if b=='A': print("T")
elif b=='C': print("G")
else print(b)


Fixed submission:
b = input()
if b=='A': print("T")
elif b=='T': print("A")
elif b=='C': print("G")
elif b=='G': print("C")
Buggy python submission (verdict: Runtime Error):
year, month, day = map(int, input().split("/"))

if year<2019:
  print("Heisei")
elif year == 2019 && month<5:
  print("Heisei")
else:
  print("TBD")

Fixed submission:
year, month, day = map(int, input().split("/"))

if year<2019:
  print("Heisei")
elif year == 2019 and month<5:
  print("Heisei")
else:
  print("TBD")

Buggy python submission (verdict: Runtime Error):
year, month, day = map(int, input().split("/"))

if year<2019:
  print("Heisei")
elif year == 2019 && month<5:
  print(Heisei)
else:
  print("TBD")

Fixed submission:
year, month, day = map(int, input().split("/"))

if year<2019:
  print("Heisei")
elif year == 2019 and month<5:
  print("Heisei")
else:
  print("TBD")
Buggy python submission (verdict: Runtime Error):
D = int(input())
print("Cristmas "+" ".joined(["eve" for i in range(25-D)]))

Fixed submission:
D = int(input())
print("Christmas "+" ".join(["Eve" for i in range(25-D)]))
Buggy python submission (verdict: Runtime Error):
s = input()
print("AC" if(s[0] == "A" and s[2:len(s)-1].count("C") == 1 and (s[1:s.find('C')]+s[s.find('C')+1:]).islower())


Fixed submission:
s = input()
print("AC" if(s[0] == "A" and s[2:len(s)-1].count("C") == 1 and (s[1:s.find('C')]+s[s.find('C')+1:]).islower()) else "WA")
Buggy python submission (verdict: Runtime Error):
x = int(input())
def isExp(num):
	if num ==1 : return True
	for i in range(2,11):
		pow(num, 1/i) % 1.0 == 0.0: return True
	return False
def solve():
	for i in range(x,0,-1):
		if isExp(i): return i

print(solve())

Fixed submission:
x = int(input())

def isPrime(n):
  if n%2 == 0 or n%3 == 0: return True
  if n<3: return False
  for i in range( 2, int(n**0.5) +1):
    if n%i == 0: return False
  return True

primes = [i for i in range(1, 32) if isPrime(i)]

def isExp(n):
  if n==1: return True
  for i in [p for p in primes if p<int(n**0.5)+1]:
    p = 0
    while i**p<=n:
      if i**p == n: return True
      p+=1
  return False

def solve():
  for i in range(x,0,-1):
    if isExp(i): return i

print(solve())

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

def isPrime(n):
  if n%2==0 or n%3==0: return True
  for i in range(2, int(n**0.5)+1):
    if n%i==0: return False
  return True
primes = [i for i in range(2,1000) if isPrime(i)]

def isExponentiation(n):
  i = 0
  flag = False
  while(primes[i]<n):
    if n%primes[i]==0:
      if flag: return False
      else: flag = True
    i+=1
  return flag

print( max([i for i in range(x) if isExponentiation(i)]) )

Fixed submission:
x = int(input())

def isPrime(n):
  if n%2 == 0 or n%3 == 0: return True
  if n<3: return False
  for i in range( 2, int(n**0.5) +1):
    if n%i == 0: return False
  return True

primes = [i for i in range(1, 32) if isPrime(i)]

def isExp(n):
  if n==1: return True
  for i in [p for p in primes if p<int(n**0.5)+1]:
    p = 0
    while i**p<=n:
      if i**p == n: return True
      p+=1
  return False

def solve():
  for i in range(x,0,-1):
    if isExp(i): return i

print(solve())