Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
n = int(input())
a = [int(input()) for _ in range(n)]
#print(a)
cnt = [0]*(10**5)
for i in a:
    cnt[i-1] += 1
print(sum([1 for i in cnt if i % 2 == 1]))
exit(0)


Fixed submission:
#!/usr/bin/env python3
n = int(input())
a = [int(input()) for _ in range(n)]
a.sort()
cnt = 1
ans = 0
for i in range(n-1):
    if a[i] == a[i+1]:
        cnt += 1
    else:
        if cnt %2: ans+= 1
        cnt = 1
print(ans+cnt%2)

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
n = int(input())
a = [int(input()) for _ in range(n)]
#print(a)
cnt = [0]*(10**5)
for i in a:
    cnt[i-1] += 1
print(sum([1 for i in cnt if i % 2 == 1]))
exit(0)


Fixed submission:
#!/usr/bin/env python3
n = int(input())
a = [int(input()) for _ in range(n)]
a.sort()
cnt = 1
ans = 0
for i in range(n-1):
    if a[i] == a[i+1]:
        cnt += 1
    else:
        if cnt %2: ans+= 1
        cnt = 1
print(ans+cnt%2)

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
n = int(input())
a = [int(input()) for _ in range(n)]
#print(a)
cnt = [0]*(10**9)
for i in a:
    cnt[i-1] += 1
print(sum([1 for i in cnt if i % 2 == 1]))
exit(0)


Fixed submission:
#!/usr/bin/env python3
n = int(input())
a = [int(input()) for _ in range(n)]
a.sort()
cnt = 1
ans = 0
for i in range(n-1):
    if a[i] == a[i+1]:
        cnt += 1
    else:
        if cnt %2: ans+= 1
        cnt = 1
print(ans+cnt%2)

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
n = int(input())
a = list(map(int,input().split()))
print(a)
cnt = [0]*(10**9)
for i in a:
    cnt[i-1] += 1
print(len([1 for i in cnt if i % 2 == 1]))

Fixed submission:
#!/usr/bin/env python3
n = int(input())
a = [int(input()) for _ in range(n)]
a.sort()
cnt = 1
ans = 0
for i in range(n-1):
    if a[i] == a[i+1]:
        cnt += 1
    else:
        if cnt %2: ans+= 1
        cnt = 1
print(ans+cnt%2)
Buggy python submission (verdict: Time Limit Exceeded):
def print_ans(s):
    """Print substring of s, odd_th char
    >>> print_ans([1])
    1
    >>> print_ans([1,4])
    1
    >>> print_ans([0,3,4,5])
    3
    >>> print_ans([1,2,3,2,5,6])
    4
    
    """
    b = list(set(s))
    ans = 1
    """TLE 
    for i in range(b[0],b[-1]+1):
        ans = max(b.count(i)+b.count(i+1)+b.count(i+2),ans)
    """
    
    for i in range(len(b)):
        ans = max(ans,s.count(b[i])+s.count(b[i]+1)+s.count(b[i]+2))
    print(ans)

if __name__ == '__main__':
    N = input()
    a = list(map(int,input().split()))
    print_ans(a)



Fixed submission:
#!/usr/bin/env python3
n = int(input())
a = list(map(int,input().split()))
cnt = [0]*(10**5)
for i in a:
    cnt[i] += 1
ans_max =0
for i in range(100000-2):
    #ans_max = max(ans_max,sum(cnt[i:i+3]))
        ans_max = max(ans_max,cnt[i]+cnt[i+1]+cnt[i+2])

print(ans_max)

Buggy python submission (verdict: Time Limit Exceeded):
def print_ans(s):
    """Print substring of s, odd_th char
    >>> print_ans([1])
    1
    >>> print_ans([1,4])
    1
    >>> print_ans([0,3,4,5])
    3
    >>> print_ans([1,2,3,2,5,6])
    4
    
    """
    b = sorted(s)
    ans = 1
    for i in range(b[0],b[-1]+1):
        ans = max(b.count(i)+b.count(i+1)+b.count(i+2),ans)
    print(ans)

if __name__ == '__main__':
    N = input()
    a = list(map(int,input().split()))
    print_ans(a)



Fixed submission:
#!/usr/bin/env python3
n = int(input())
a = list(map(int,input().split()))
cnt = [0]*(10**5)
for i in a:
    cnt[i] += 1
ans_max =0
for i in range(100000-2):
    #ans_max = max(ans_max,sum(cnt[i:i+3]))
        ans_max = max(ans_max,cnt[i]+cnt[i+1]+cnt[i+2])

print(ans_max)
Buggy python submission (verdict: Runtime Error):
import string
def print_ans(s):

  A=string.ascii_lowercase
  B=list(set(A)-set(S))
  B.sort()
  print_ans(B[0] if B else 'None')

if __name__ == '__main__':
    S = input()
    print_ans(S)



Fixed submission:
#!/usr/bin/env python3
import sys
s = input()
for i in range(26):
    if chr(97+i) not in s: 
        print(chr(97+i)) 
        break
    if i == 25:
        print("None")

Buggy python submission (verdict: Runtime Error):
import string
def print_ans(s):
    """Print substring of s, odd_th char
    >>> print_ans("abcdefghijklmnopqrstuvwxyz")
    None
    >>> print_ans("cbbbaeae")
    d
    >>> print_ans("b")
    a
    >>> print_ans("abc")
    d
    
    """
    a = string.ascii_lowercase
    b = list(set(a)-set(s)) #diff of list a and list b
    b.sort()

    print_ans(b[0] if b else 'None')

if __name__ == '__main__':
    S = input()
    print_ans(S)



Fixed submission:
#!/usr/bin/env python3
import sys
s = input()
for i in range(26):
    if chr(97+i) not in s: 
        print(chr(97+i)) 
        break
    if i == 25:
        print("None")
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
T = []
for i in range(N):
  T.append(int(input()))
# output LCM(T1,T2... Tn)=LCM(Tn,LCM(Tn-1,LCM(...)))
def lcm(a,b):
  g = math.gcd(a,b)
  #print(g)
  return int(a*b/g)
ans = T[0]
for i in range(1,len(T)):
  ans = lcm(ans,T[i])
print(ans)


Fixed submission:
#import math
N = int(input())
T = []
for i in range(N):
  T.append(int(input()))
# output LCM(T1,T2... Tn)=LCM(Tn,LCM(Tn-1,LCM(...)))
def gcd(a,b): #Recusion!!
  if min(a,b) == 0:
    return max(a,b)
  else:
    return gcd(min(a,b),max(a,b)%min(a,b))
    
"""
  mi = min(a,b)
  ma = max(a,b)
  ans = 1
  '''for i in range(2,mi+1):
    if (mi%i)+(ma%i) == 0:
      mi /= i
      ma /= i
      ans *= i
      i -= 1'''
  while True:
    #print(ma,mi)
    if (ma % mi) == 0:
      ans = mi
      break
    else:
      mi = ma%mi
      ma = mi
      
  return ans"""


def lcm(a,b):
  #g = math.gcd(a,b)
  g = gcd(a,b)
  #print(g)
  return int(a*b//g)
ans = T[0]
for i in range(1,len(T)):
  ans = lcm(ans,T[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
for i in range(26):
    if chr(97+i) not in s: 
        print(chr(97+i)) 
        break
    if i == 25:
        print("None")
l.sort(reverse=True)
print(sum(l[:k]))
s = input()
for i in range(1,len(s)-1):
	if (len(s) - i) % 2 == 1: pass
	elif s[:(len(s) - i)//2] == s[(len(s) - i)//2:-i]:
		print(len(s) - i)
		#print(s[:-i])
		break

Fixed submission:
#!/usr/bin/env python3
s = input()
for i in range(1,len(s)-1):
	if (len(s) - i) % 2 == 1: pass
	elif s[:(len(s) - i)//2] == s[(len(s) - i)//2:-i]:
		print(len(s) - i)
		#print(s[:-i])
		break
Buggy python submission (verdict: Runtime Error):
x,a,b = = map(int,input().split())
if b <= a: print("delicious")
elif b <= a + x: print("safe")
else: print("dangerous")

Fixed submission:
x,a,b = map(int,input().split())
print("delicious" if b-a <= 0 else "safe" if b-a <= x else "dangerous")
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
n = int(input())
a = list(map(int,input().split()))
cnt = 0
current_sum = a[0]#現在の操作後の値
# 正負どちらを起点にするかで2通り考える必要がある。
# a[0]に従うパターン
for i in range(n-1):
    if current_sum * (current_sum + a[i+1]) < 0:#符号が違う
        current_sum += a[i+1]
        cnt += 0#そのまま
    elif current_sum < 0:
        cnt += 1 - (current_sum + a[i+1])
        current_sum = 1 
    else:
        cnt += (current_sum + a[i+1]) +1 
        current_sum = -1
case1 = cnt

cnt = abs(a[0])+1
current_sum = -1 * a[0] // abs(a[0])#現在の操作後の値
for i in range(n-1):
    if current_sum * (current_sum + a[i+1]) < 0:#符号が違う
        current_sum += a[i+1]
        cnt += 0#そのまま
    elif current_sum < 0:
        cnt += 1 - (current_sum + a[i+1])
        current_sum = 1 
    else:
        cnt += (current_sum + a[i+1]) +1 
        current_sum = -1
#print(cnt,case1)
print(min(cnt,case1))

Fixed submission:
#!/usr/bin/env python3
n = int(input())
a = list(map(int,input().split()))
def solve(cnt,current_sum):
    for i in range(n-1):
        if current_sum * (current_sum + a[i+1]) < 0:#符号が違う
            current_sum += a[i+1]
            cnt += 0#そのまま
        elif current_sum < 0:
            cnt += 1 - (current_sum + a[i+1])
            current_sum = 1 
        else:
            cnt += (current_sum + a[i+1]) +1 
            current_sum = -1
    return cnt
if a[0] > 0:
    print(min(solve(0,a[0]),solve(1+abs(a[0]),-1)))
elif a[0] < 0:
    print(min(solve(0,a[0]),solve(1+abs(a[0]),1)))
else:
    print(min(solve(1,1),solve(1,-1)))
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
n = int(input())
a = list(map(int,input().split()))
if (a[1]-a[0]) < 0: flag = -1
else: flag = 1
ans = 1
i = 0
while True:
    if flag * (a[i+1]-a[i]) < 0:#増加
        ans += 1
        flag = -1 * flag
        i += 1
    i += 1
    if i == n-1:
        break
    elif i == n:
        ans += 1
        break
print(ans)
    

Fixed submission:
#!/usr/bin/env python3
n = int(input())
a = list(map(int,input().split()))
bit = 0
ans = 1
i = 0
while i < n-1:
    if a[i+1] == a[i]: pass
    if bit == 0:
        bit = a[i+1]-a[i]
        #ans += 1
    else:#bit が立っているなら符号が一致するかを見て一致しないならans +=  1
        if bit * (a[i+1]-a[i]) < 0:#符号不一致
            bit = 0 
            ans += 1 
    i += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
# input
from collections import deque
import itertools

n, m = map(int, input().split())
a, b = [0] * (n), [0] * (n)
path = [[] for _ in range(n)]
for i in range(m):
    a[i], b[i] = map(int, input().split())
    a[i] -= 1
    b[i] -= 1
    path[a[i]].append(b[i])
    path[b[i]].append(a[i])
# n-1 ! を全探索する
all_lis = itertools.permutations(range(1, n))  # 1(0)は出発点なので除く
# print(all_lis)

ans = 0
for i in all_lis:
    start = 0
    ok = 1
    for j in range(n - 1):
        if i[j] not in path[start]:
            ok = 0
            break
        else:
            start = i[j]
    if ok:
        ans += 1
print(ans)


Fixed submission:
#!/usr/bin/env python3
# input
from collections import deque
import itertools

n, m = map(int, input().split())
path = [[] for _ in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    path[a].append(b)
    path[b].append(a)
# n-1 ! を全探索する
all_lis = itertools.permutations(range(1, n))  # 1(0)は出発点なので除く
# print(all_lis)

ans = 0
for i in all_lis:
    start = 0# これをfor の外においていて爆死。
    ok = 1
    for j in range(n - 1):
        if i[j] not in path[start]:
            ok = 0
            break
        else:
            start = i[j]
    if ok:
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
# input
from collections import deque
import itertools

n, m = map(int, input().split())
a, b = [0] * (n), [0] * (n)
path = [[] for _ in range(n)]
for i in range(m):
    a[i], b[i] = map(int, input().split())
    a[i] -= 1
    b[i] -= 1
    path[a[i]].append(b[i])
    path[b[i]].append(a[i])
# n-1 ! を全探索する
all_lis = itertools.permutations(range(1, n))  # 1(0)は出発点なので除く
# print(all_lis)

ans = 0
for i in all_lis:
    start = 0
    ok = 1
    for j in range(n - 1):
        if i[j] not in path[start]:
            ok = 0
            break
        else:
            start = i[j]
    if ok:
        ans += 1
print(ans)


Fixed submission:
#!/usr/bin/env python3
# input
from collections import deque
import itertools

n, m = map(int, input().split())
path = [[] for _ in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    path[a].append(b)
    path[b].append(a)
# n-1 ! を全探索する
all_lis = itertools.permutations(range(1, n))  # 1(0)は出発点なので除く
# print(all_lis)

ans = 0
for i in all_lis:
    start = 0# これをfor の外においていて爆死。
    ok = 1
    for j in range(n - 1):
        if i[j] not in path[start]:
            ok = 0
            break
        else:
            start = i[j]
    if ok:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
s = [ input() for i in [0]*3]
current = 0
while len(s[current]) >= 0 :
  if len(s[ord(s[current][-1]) - 97]) == 0:
    print(s[current][-1].upper())
    break
  else:
    tmp = s[current][-1] # 末尾の値を保存
    s[current] = s[current][:-1] # 末尾を消去する
    current = ord(tmp) - 97
    # 末尾の値にcurrentを更新する



Fixed submission:
#!/usr/bin/env python3
s = [input() for _ in range(3)]
pos = 0#a,b,c ordにして97からひく
idx = [0,0,0] #ABCそれぞれの現在のindex
for i in range(300):#大きめにとってもbreakするのでOK
	if idx[pos] == len(s[pos]):
		print(chr(65+pos))
		exit()
	idx[pos] += 1 #idxの更新
	pos = ord(s[pos][idx[pos] - 1]) - 97 # asciiの文字にして引く、更新する前のidx で次の文字列を判定して更新
	#print(pos)
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main()
{
  int N;
  cin >> N;
  vector<long long> a(N);
  for (int i = 0; i < N; ++i)
    cin >> a[i];
  long long res = 0, cur_sum = 0;
  for (int i = 0; i < N;)
  {
    int j = i;
    while (j < N && a[j])
      cur_sum += a[j++];
    res += cur_sum / 2;
    cur_sum = 0;
    i = j + 1;
  }
  cout << res << endl;
}

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
ans = 0
cur_sum = 0  # 0が入るまでのsum
for i in range(n):
    if a[i] == 0:
        ans += cur_sum // 2
        cur_sum = 0
    else:
        cur_sum += a[i]
ans += cur_sum // 2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    n = int(input())
    d = [0 for _ in range(n + 1)]
    ans = 0
    for i in range(1, n+1):
        for j in range(i, n+1, i):
            d[j] += j
    print(sum(d))




if __name__ == '__main__':
    solve()


Fixed submission:
def solve():
    n = int(input())
    ans = 0
    for x in range(1, n + 1):
        ans += ((n // x) * ((n // x) + 1) * x) // 2
    print(ans)






if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
def solve():
    N = int(input())
    a = list(map(int, input().split()))
    s = sum(a)
    q = int(input())
    n = [0 for _ in range(100000)]
    for i in a:
        n[i] += 1
    for _ in range(q):
        b, c = map(int, input().split())
        s += (c - b) * n[b]
        print(s)
        n[c] += n[b]
        n[b] = 0


if __name__ == '__main__':
    solve()


Fixed submission:
def solve():
    N = int(input())
    a = list(map(int, input().split()))
    s = sum(a)
    q = int(input())
    n = [0 for _ in range(100000+1)]
    for i in a:
        n[i] += 1
    for _ in range(q):
        b, c = map(int, input().split())
        s += (c - b) * n[b]
        print(s)
        n[c] += n[b]
        n[b] = 0


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
print(eval(input().replace(' ','*'))

Fixed submission:
print(eval(input().replace(' ','*')))

Buggy python submission (verdict: Runtime Error):
print(eval(input().replace(' ','*'))

Fixed submission:
print(eval(input().replace(' ','*')))
Buggy python submission (verdict: Runtime Error):
def solve():
    N = int(input())
    A = eval(input().replace(' ', '*'))
    if A > 10**18:
        print(-1)
    else:
        print(A)


if __name__ == '__main__':
    solve()


Fixed submission:
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    if 0 in A:
        print(0)
        exit()
    mul = A[0]
    for v in A[1:]:
        mul *= v
        if mul > 10**18:
            print(-1)
            exit()
    print(mul)





if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
import math


def solve():
    A, B = input().split()
    A = int(A)
    B = math.floor(B*100)
    print(A*B//100)


if __name__ == '__main__':
    solve()


Fixed submission:
import math


def solve():
    A, B = input().split()
    print(int(A) * int(B[-4] + B[-2:]) // 100)



if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    s = input()
    t = input()
    for i in range(len(s)):
        if s[i] != t[i]:
            tmp = s[i]
            s = s.replace(s[i], '*')
            s = s.replace(t[i], tmp)
            s = s.replace('*', t[i])
    if s == t:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    solve()


Fixed submission:
from collections import Counter
def solve():
    s = input()
    t = input()
    s_cnt = Counter(s)
    t_cnt = Counter(t)
    if all(sv == tv for sv, tv in zip(sorted(s_cnt.values()), sorted(t_cnt.values()))):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    n = int(input())
    i = n
    while True:
        if i % 2 == 0 and i % n == 0:
            print(i)
            exit()


if __name__ == "__main__":
    solve()


Fixed submission:
def solve():
    n = int(input())
    i = n
    while True:
        if i % 2 == 0:
            print(i)
            exit()
        i += n



if __name__ == "__main__":
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    A_i = [A[i] - i - 1 for i in range(N)]
    ans = 10 ** 9
    for i in range(min(A_i), max(A_i) + 1):
        sums = 0
        for a in A_i:
            sums += abs(a - i)
        ans = min(ans, sums)
    print(ans)


if __name__ == "__main__":
    solve()

Fixed submission:
import statistics


def solve():
    N = int(input())
    A = list(map(int, input().split()))
    A_i = [A[i] - i - 1 for i in range(N)]
    b = statistics.median_high(A_i)
    print(sum(abs(a - b) for a in A_i))



if __name__ == "__main__":
    solve()
Buggy python submission (verdict: Runtime Error):
def solve():
    A, B, K = map(int, input().split())
    ans = list(range(A, B + 1))
    if B - A >= K * 2:
        ans = sorted((set(ans[:min(B-A, K)] + ans[min(0, -K):])), key=ans.index)

    for a in ans:
        print(a)


if __name__ == "__main__":
    solve()


Fixed submission:
def solve():
    A, B, K = map(int, input().split())
    for i in range(A, min(A+K, B+1)):
        print(i)
    for j in range(max(A+K, B-K+1), B+1):
        print(j)


if __name__ == "__main__":
    solve()

Buggy python submission (verdict: Runtime Error):
def solve():
    A, B, K = map(int, input().split())
    if A == B:
        print(A)
        exit()
    ans = list(range(A, B + 1))
    if B - A >= K * 2:
        ans = sorted((set(ans[:K] + ans[-K:])), key=ans.index)

    for a in ans:
        print(a)


if __name__ == "__main__":
    solve()


Fixed submission:
def solve():
    A, B, K = map(int, input().split())
    for i in range(A, min(A+K, B+1)):
        print(i)
    for j in range(max(A+K, B-K+1), B+1):
        print(j)


if __name__ == "__main__":
    solve()

Buggy python submission (verdict: Runtime Error):
def solve():
    A, B, K = map(int, input().split())
    ans = list(range(A, B + 1))
    if B - A >= K * 2:
        ans = sorted((set(ans[:K] + ans[-K:])), key=ans.index)

    for a in ans:
        print(a)


if __name__ == "__main__":
    solve()


Fixed submission:
def solve():
    A, B, K = map(int, input().split())
    for i in range(A, min(A+K, B+1)):
        print(i)
    for j in range(max(A+K, B-K+1), B+1):
        print(j)


if __name__ == "__main__":
    solve()

Buggy python submission (verdict: Runtime Error):
def solve():
    A, B, K = map(int, input().split())
    ans = list(range(A,B+1))
    ans = sorted((set(ans[:K] + ans[-K:])), key=ans.index)

    for a in ans:
        print(a)


if __name__ == "__main__":
    solve()

Fixed submission:
def solve():
    A, B, K = map(int, input().split())
    for i in range(A, min(A+K, B+1)):
        print(i)
    for j in range(max(A+K, B-K+1), B+1):
        print(j)


if __name__ == "__main__":
    solve()
Buggy python submission (verdict: Runtime Error):
x = int(input())

if x == 1:
  print(0)
elif X == 0:
  print(1)

Fixed submission:
x = int(input())

if x == 1:
  print(0)
elif x == 0:
  print(1)
else:
  pass
Buggy python submission (verdict: Runtime Error):
a,b,c,d = int(input())

l = list[]
l.append(a*c)
l.append(b*c)
l.append(a*d)
l.append(b*d)

print(max(l))

Fixed submission:
a,b,c,d = map(int,input().split())
 
l = []
l.append(a*c)
l.append(b*c)
l.append(a*d)
l.append(b*d)
 
print(max(l))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

t = 0

for i in range (1,N+1):
  p = N//i
  s = int(i*p*(1+p)/2)
  t = t+s

print(t)

Fixed submission:
N = int(input())

t = 0

for i in range (1,N+1):
  p = N//i
  t += i*p*(1+p)/2
  

print(int(t))

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

t = int(0)

for i in range (1,N+1):
  p = N//i
  s = int(p*(2*i+(p-1)*i)/2)
  t = t + s

print(t)

Fixed submission:
N = int(input())

t = 0

for i in range (1,N+1):
  p = N//i
  t += i*p*(1+p)/2
  

print(int(t))

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


S = 0

for k in range(N+1):
  D = [0]
  for i in range(1,k):
    if k % i == 0:
      D.append(i)
  S = S + k*len(D)

print(S)
    

Fixed submission:
N = int(input())

t = 0

for i in range (1,N+1):
  p = N//i
  t += i*p*(1+p)/2
  

print(int(t))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(i) for i in input().split()]
prd = 1
if 0 in a:
  print(0)
  exit()
for i in range(n):
  prd*=a[i]
if prd > 10**18:
  print(-1)
else:
  print(prd)

Fixed submission:
import sys

n = int(input())
a = [int(i) for i in input().split()]
prd = 1
if 0 in a:
  print(0)
  sys.exit()
for i in range(n):
  prd*=a[i]
  if prd > 10**18:
    print(-1)
    sys.exit()
print(prd)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(i) for i in input().split()]
prd = 1
for i in range(n):
  prd*=a[i]
if prd > 10**18:
  print(-1)
else:
  print(prd)

Fixed submission:
import sys

n = int(input())
a = [int(i) for i in input().split()]
prd = 1
if 0 in a:
  print(0)
  sys.exit()
for i in range(n):
  prd*=a[i]
  if prd > 10**18:
    print(-1)
    sys.exit()
print(prd)
Buggy python submission (verdict: Runtime Error):
import math

A,B,H,M = map(int, input().split())

h = H/6
n = M/30

CC = A**2 + B**2 + 2*A*B*math.cos((h-n)*math.pi)\  
C= math.sqrt(CC)

print(C)

Fixed submission:
n = int(input())
b = n%10

if b == 3:
  print('bon')
elif b == 1 or b == 6 or b ==8 or b == 0:
  print('pon')
else:
  print('hon')

Buggy python submission (verdict: Runtime Error):
import math

A,B,H,M = map(int, input().split())

h = H/6
n = M/30

CC = A**2 + B**2 + 2*A*B*math.cos((h-n)*math.pi)\  
C= math.sqrt(CC)

print(CC)
print(C)

Fixed submission:
n = int(input())
b = n%10

if b == 3:
  print('bon')
elif b == 1 or b == 6 or b ==8 or b == 0:
  print('pon')
else:
  print('hon')
Buggy python submission (verdict: Runtime Error):
from sys import stdin
input = stdin.readline

S = input()
n = len(S)

tot = 0

for i in range(2**(n-1)):
  f = S[0]
  for j in range(n-1):
       if ((i >> j) & 1):
        f += " "
       f += S[j+1]
  
  tot += sum(map(int, f.split(" ")))

print(tot)

Fixed submission:
S = input()
n = len(S)

tot = 0

for i in range(2**(n-1)):
  f = S[0]
  for j in range(n-1):
       if ((i >> j) & 1):
        f += " "
       f += S[j+1]
  
  tot += sum(map(int, f.split(" ")))

print(tot)
Buggy python submission (verdict: Runtime Error):
def _print():
  a = int(input())
  print(1 if a == 0 else 0)

if __name__ = '__main__':
  _print()

Fixed submission:
num = int(input())
if num == 1:
  print(0)
else:
  print(1)

Buggy python submission (verdict: Runtime Error):
num = int(input())
if num == 1:
  print(0)
 else:
  print(1)


Fixed submission:
num = int(input())
if num == 1:
  print(0)
else:
  print(1)

Buggy python submission (verdict: Runtime Error):
num = int(input())
if num == 1:
  print(1)
 else:
  print(0)


Fixed submission:
num = int(input())
if num == 1:
  print(0)
else:
  print(1)

Buggy python submission (verdict: Runtime Error):
num = input()
if num == 1:
  print(1)
 else:
  print(0)

Fixed submission:
num = int(input())
if num == 1:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
print(int(int(input() / 1000 + 1) * 1000 - N)

Fixed submission:
N = int(input())
if N % 1000 == 0:
  print(0)
else:
  print(int(N / 1000 + 1) * 1000 - N )
Buggy python submission (verdict: Runtime Error):
L = []
for i in range(int(input)):
  l.append(input())
for j in ['AC','WA','TLE','RE']:
  print(L.count(j))

Fixed submission:
L = []
for i in range(int(input())):
  L.append(input())
for j in ['AC','WA','TLE','RE']:
  print(j,'x',L.count(j))