Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
s = str(input())
n = len(s)

cum = [[0]*(n+1) for _ in range(26)]

for i in range(26):
    c = chr(i + ord('a'))
    for j in range(n):
        if s[j] == c:
            cum[i][j+1] = cum[i][j]+1
        else:
            cum[i][j+1] = cum[i][j]


for i in range(26):
    for j in range(n+1):
        cum[i][j] = 2*cum[i][j] -j

from collections import deque

for i in range(26):
    min_ = 10**6
    min_id = -1
    q = deque()
    for j in range(n+1):
        if j == 0:
            q.append((cum[i][j], j))
        elif j == 1:
            q.append((cum[i][j], j))
        else:
            temp, temp_id = q.popleft()
            if temp <= min_:
                min_ = temp
                min_id = temp_id
            if cum[i][j] - min_ > 0:
                print(min_id+1, j)
                exit()
            q.append((cum[i][j], j))
else:
    print(-1, -1)

Fixed submission:
s = str(input())
n = len(s)

cum = [[0]*(n+1) for _ in range(26)]

for i in range(26):
    c = chr(i + ord('a'))
    for j in range(n):
        if s[j] == c:
            cum[i][j+1] = cum[i][j]+1
        else:
            cum[i][j+1] = cum[i][j]


for i in range(26):
    for j in range(n+1):
        cum[i][j] = 2*cum[i][j] -j

from collections import deque

for i in range(26):
    min_ = 10**6
    min_id = -1
    q = deque()
    for j in range(n+1):
        if j == 0:
            q.append((cum[i][j], j))
        elif j == 1:
            q.append((cum[i][j], j))
        else:
            temp, temp_id = q.popleft()
            if temp <= min_:
                min_ = temp
                min_id = temp_id
            if cum[i][j] - min_ > 0:
                print(min_id+1, j)
                exit()
            q.append((cum[i][j], j))
else:
    print(-1, -1)
Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())

n = 0
for i in range(a, b+1):
  if i < 0:
    n += 1
  elif i == 0:
    print('Zero')
    exit()

if n%2 == 1:
  print('Negative')
else:
  print('Positive')

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

if a > 0 and b > 0:
  print('Positive')
elif a < 0 and b < 0:
  if (b-a+1)%2 == 0:
    print('Positive')
  else:
    print('Negative')
else:
  print('Zero')
Buggy python submission (verdict: Runtime Error):
if(int(input()) >= 30:
   print('Yes')
else:
   print('No')

Fixed submission:
if(int(input())) >= 30:
   print('Yes')
else:
   print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
counter = 1
for i in range(k):
    counter *= a[i]
for i in range(k, n):
    after = counter // a[i-k] * a[i]
    if after > counter:
        print('Yes')
    else: 
        print('No')
    counter = after

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(0, n-k):
    if a[i] >= a[i+k]:
        print('No')
    else:
        print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
counter = 1
for i in range(k):
    counter *= a[i]
for i in range(k, n):
    after = counter // a[i-k] * a[i]
    if after > counter:
        print('Yes')
    else: 
        print('No')
    counter = after

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(0, n-k):
    if a[i] >= a[i+k]:
        print('No')
    else:
        print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
counter = 1
for i in range(k):
    counter *= a[i]
for i in range(k, n):
    after = counter / a[i-k] * a[i]
    if after > counter:
        print('Yes')
    else: 
        print('No')
    counter = after

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(0, n-k):
    if a[i] >= a[i+k]:
        print('No')
    else:
        print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
for i in range(1, n+1):
    ans = 0
    for j in range(1, 15):
        for k in range(1, 15):
            for l in range(1, 15):
                if j ** 2 + k ** 2 + l ** 2 + j * k + k * l + l * j == i:
                    ans += 1
    print(ans)

Fixed submission:
n = int(input())
ans = [0] * 10010
for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            x = i * i + j * j + k * k + i * j + j * k + k * i
            if x <= n:
                ans[x] += 1
for i in range(1, n+1):
    print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = 1
for i in range(n):
    ans *= a[i]
if ans > 1000000000000000000: print(-1)
else: print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 1
a = sorted(a)
for i in range(n):
    ans *= a[i]
    if ans > 1000000000000000000:
        print(-1)
        exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
w = []
for i in range(n):
    w.append(input())
ok = True
for i in range(n-1):
    sz = len(w[i])
    if w[i][sz-1] != w[i+1][0]: ok = False
for i in range(n):
    for j in range(n):
        if i != j and w[i] == w[j]:
            ok = False
if ok: print('Yes')
else: print('No')


Fixed submission:
a,b = map(int,input().split())
if a % 2 == 0 or b % 2 == 0: print('No')
else: print('Yes')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(min({a+b,a-b,a*b})

Fixed submission:
a,b = map(int,input().split())
print(max(a+b,max(a-b,a*b)))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
ans=10000000
for i in range(n+1):
    s1 = s[0:i]
    s2 = s[i:n]
    w=s1.count('W')
    e=s2.count('E')
    counter=w+e
    ans=min(ans,counter)
print(ans)

Fixed submission:
n = int(input())
s = input()
east = s.count('E')
ans = east
for i in range(n):
  if s[i]=='E': east-=1
  if i>=1:
    if s[i-1]=='W': east+=1
  ans = min(ans,east)
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
s[3] = '8'
print(s)

Fixed submission:
a,b,c = input().split('/')
n = int(a)
n += 1
print("{}/{}/{}".format(n,b,c))
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define rrep(i,n) for(int i=1; i<=(int)(n); i++)
#define pb push_back
#define all(v) v.begin(),v.end()
#define fi first
#define se second
#define bigger (char)toupper
#define smaller (char)tolower
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef vector<char> vc;
typedef long long ll;
typedef unsigned long long ull;

int main() {
    ll A,B,C;
    cin>>A>>B>>C;
    if(A%2==0||B%2==0||C%2==0) cout<<0<<endl;
    else {
        vector<ll> v;
        v.pb(A);
        v.pb(B);
        v.pb(C);
        sort(all(v));
        cout<<v[0]*v[1]<<endl;
    }
}

Fixed submission:
A,B,C = map(int,input().split())
if A%2==0 or B%2==0 or C%2==0:
  print(0)
else:
  print(A*B*C//max({A,B,C}))
Buggy python submission (verdict: Runtime Error):
s = input()
alphabets = [0] * 26
for i in range(len(s)):
    x = ord(s[i])
    alphabets[x-97] += 1
flag = True
for x in alphabets:
    if x % 2 != 0:
        ok = False
if ok:
    print('Yes')
else:
    print('No')

Fixed submission:
s = input()
alphabets = [0] * 26
for i in range(len(s)):
  a = ord(s[i])
  alphabets[a-97] += 1
flag = True
for x in alphabets:
  if x % 2 != 0:
    flag = False
if flag:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
def dist(p, q):
    return abs(p[0] - q[0]) + abs(p[1] - q[1])

n = int(input())
ans = 0
P = [tuple(map(int, input().split())) for _ in range(n)]
P.sort(key=lambda p: (p[0], p[1]))
ans = max(ans, max(dist(P[0], q) for q in P[1:]))
ans = max(ans, max(dist(P[-1], q) for q in P[:-1]))
P.sort(key=lambda p: (p[0], -p[1]))
ans = max(ans, max(dist(P[0], q) for q in P[1:]))
ans = max(ans, max(dist(P[-1], q) for q in P[:-1]))
P.sort(key=lambda p: (p[1], p[0]))
ans = max(ans, max(dist(P[0], q) for q in P[1:]))
ans = max(ans, max(dist(P[-1], q) for q in P[:-1]))
P.sort(key=lambda p: (p[1], -p[0]))
ans = max(ans, max(dist(P[0], q) for q in P[1:]))
ans = max(ans, max(dist(P[-1], q) for q in P[:-1]))

P.sort(key=lambda p: (-p[0], p[1]))
ans = max(ans, max(dist(P[0], q) for q in P[1:]))
ans = max(ans, max(dist(P[-1], q) for q in P[:-1]))
P.sort(key=lambda p: (-p[0], -p[1]))
ans = max(ans, max(dist(P[0], q) for q in P[1:]))
ans = max(ans, max(dist(P[-1], q) for q in P[:-1]))
P.sort(key=lambda p: (-p[1], p[0]))
ans = max(ans, max(dist(P[0], q) for q in P[1:]))
ans = max(ans, max(dist(P[-1], q) for q in P[:-1]))
P.sort(key=lambda p: (-p[1], -p[0]))
ans = max(ans, max(dist(P[0], q) for q in P[1:]))
ans = max(ans, max(dist(P[-1], q) for q in P[:-1]))
print(ans)

Fixed submission:
def dist(p, q):
    return abs(p[0] - q[0]) + abs(p[1] - q[1])

n = int(input())
ans = 0
peri = []
P = [tuple(map(int, input().split())) for _ in range(n)]
P.sort(key=lambda p: (p[0], p[1]))
peri.append(max(P, key=lambda p: (p[0], p[1])))
peri.append(min(P, key=lambda p: (p[0], p[1])))
peri.append(max(P, key=lambda p: (p[0], -p[1])))
peri.append(min(P, key=lambda p: (p[0], -p[1])))
peri.append(max(P, key=lambda p: (-p[0], p[1])))
peri.append(min(P, key=lambda p: (-p[0], p[1])))
peri.append(max(P, key=lambda p: (-p[0], -p[1])))
peri.append(min(P, key=lambda p: (-p[0], -p[1])))
peri.append(max(P, key=lambda p: (p[1], p[0])))
peri.append(min(P, key=lambda p: (p[1], p[0])))
peri.append(max(P, key=lambda p: (-p[1], p[0])))
peri.append(min(P, key=lambda p: (-p[1], p[0])))
peri.append(max(P, key=lambda p: (p[1], -p[0])))
peri.append(min(P, key=lambda p: (p[1], -p[0])))
peri.append(max(P, key=lambda p: (-p[1], -p[0])))
peri.append(min(P, key=lambda p: (-p[1], -p[0])))
peri.append(max(P, key=lambda p: p[0]+p[1]))
peri.append(max(P, key=lambda p: -p[0]+p[1]))
peri.append(max(P, key=lambda p: p[0]-p[1]))
peri.append(max(P, key=lambda p: -p[0]-p[1]))

peri = set(peri)

for p in P:
    for q in peri:
        ans = max(ans, dist(p, q))
print(ans)
Buggy python submission (verdict: Runtime Error):
x, n = map(int, input().split())
P = list(map(int, input().split()))
if not P:
    print(x)
	exit(0)
for i in range(x, 102):
    if i not in P:
        upper = i
        break
    else:
        upper = 102
for i in range(x, -1, -1):
    if i not in P:
        lower = i
        break
    else:
        lower = 0
print(lower if x-lower <= upper - x else upper)

Fixed submission:
x, n = map(int, input().split())
P = list(map(int, input().split()))
if not P:
    print(x)
    exit(0)
for i in range(x, 102):
    if i not in P:
        upper = i
        break
    else:
        upper = 102
for i in range(x, -1, -1):
    if i not in P:
        lower = i
        break
    else:
        lower = 0
print(lower if x-lower <= upper - x else upper)
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
from operator import mul
n = int(input())
A = map(int, input().split())
ans = reduce(mul, A)
print(ans if ans <= 10**18 else -1)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
if 0 in A:
    print(0)
else:
    bound = 10 ** 18
    ans = 1
    for a in A:
        ans = ans * a
        if ans > bound:
            ans = -1
            break
    print(ans)
Buggy python submission (verdict: Runtime Error):
t = input()
n = len(t)
ans = list(t)
for i, c in enumerate(t):
    if c == '?':
        if i == 0:
            if t[i+1] == 'P':
                s = 'D'
            else:
                s = 'P'
        elif i == n-1:
            s = 'D'
        else:
            if ans[i-1] == 'D' and t[i+1] == 'P':
                s = 'D'
            elif ans[i-1] == 'D' and t[i+1] == 'D':
                s = 'P'
            elif ans[i-1] == 'P' and t[i+1] == 'P':
                s = 'D'
            elif ans[i-1] == 'P' and t[i+1] == 'D':
                s = 'D'
            elif ans[i-1] == 'P' and t[i+1] == '?':
                s = 'D'
            elif ans[i-1] == 'D' and t[i+1] == '?':
                s = 'P'
    else:
        s = c
    ans[i] = s
print(''.join(ans))

Fixed submission:
def main():
    t = input()
    if t == '?':
        return 'D'
    n = len(t)
    ans = list(t)
    for i, c in enumerate(t):
        if c == '?':
            if i == 0:
                if t[i+1] == 'P':
                    s = 'D'
                else:
                    s = 'P'
            elif i == n-1:
                s = 'D'
            else:
                if ans[i-1] == 'D' and t[i+1] == 'P':
                    s = 'D'
                elif ans[i-1] == 'D' and t[i+1] == 'D':
                    s = 'P'
                elif ans[i-1] == 'P' and t[i+1] == 'P':
                    s = 'D'
                elif ans[i-1] == 'P' and t[i+1] == 'D':
                    s = 'D'
                elif ans[i-1] == 'P' and t[i+1] == '?':
                    s = 'D'
                elif ans[i-1] == 'D' and t[i+1] == '?':
                    s = 'P'
        else:
            s = c
        ans[i] = s
    return ''.join(ans)

print(main())
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
A = list(map(int, input().split()))
route = [1]
dest = A[0]
while dest not in route:
    route.append(dest)
    dest = A[dest - 1]
ind = route.index(dest)
cycle = route[ind:]
if k >= ind:
    ans = (k - ind) % len(cycle)
    print(cycle[ans])
else:
    print(route[k])

Fixed submission:
n, k = map(int, input().split())
A = list(map(int, input().split()))
route = [1]
dest = A[0]
check = {i: False for i in range(n)}
while not check[dest - 1]:
    check[dest - 1] = True
    route.append(dest)
    dest = A[dest - 1]
ind = route.index(dest)
cycle = route[ind:]
if k >= ind:
    ans = (k - ind) % len(cycle)
    print(cycle[ans])
else:
    print(route[k])
Buggy python submission (verdict: Runtime Error):
k = int(input())
a, b = map(int, input())
if k == 1 or (a // k == a / k):
  print('OK')
else:
  n = a // k
  m = b // k
  if m - n >= 1:
    print('OK')
  else:
    print('NG')

Fixed submission:
k = int(input())
a, b = map(int, input().split())
if k == 1 or (a // k == a / k):
  print('OK')
else:
  n = a // k
  m = b // k
  if m - n >= 1:
    print('OK')
  else:
    print('NG')
Buggy python submission (verdict: Runtime Error):
print(int(inpuut())*4)

Fixed submission:
print(int(input())**2)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
if s(:int(n/2)) == s(int(n/2):):
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())
s=input()
if s[:int(n/2)] == s[int(n/2):]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
A = inintl()

MOD = 1000000007

ans = 0

for i in range(n-1):
    for j in range(i+1,n):
        ans += A[i]*A[j] % MOD
        ans %= MOD

print(ans)

Fixed submission:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
A = inintl()

S = [0]*(n+1)
ans = 0

for i in range(n):
    S[i+1] = S[i] + A[i]

for i in range(1,n):
    ans += A[i-1]*(S[-1] - S[i])
    ans %= (10**9 + 7)

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

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


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
A = inintl()

MOD = 1000000007

ans = 0

for i in range(n-1):
    for j in range(i+1,n):
        ans += A[i]*A[j] % MOD
        ans %= MOD

print(ans)

Fixed submission:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
A = inintl()

S = [0]*(n+1)
ans = 0

for i in range(n):
    S[i+1] = S[i] + A[i]

for i in range(1,n):
    ans += A[i-1]*(S[-1] - S[i])
    ans %= (10**9 + 7)

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

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from itertools import combinations


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
A = inintl()

MOD = 1000000007

ans = 0

for c in combinations(A,2):
    ans += c[0]*c[1] % MOD

print(ans % MOD)

Fixed submission:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
A = inintl()

S = [0]*(n+1)
ans = 0

for i in range(n):
    S[i+1] = S[i] + A[i]

for i in range(1,n):
    ans += A[i-1]*(S[-1] - S[i])
    ans %= (10**9 + 7)

print(ans % (10**9 + 7))
Buggy python submission (verdict: Runtime Error):
重複なimport sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
L = inintl()

ans = 0

for i in range(n):
    for j in range(n):
        for k in range(n):
            if i < j < k and (L[i]+L[j] > L[k] and L[j]+L[k] > L[i] and L[k]+L[i] > L[j]) and (L[i] != L[j] and L[i] != L[k] and L[j] != L[k]):
                ans += 1

print(ans)


Fixed submission:
import sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
L = inintl()

ans = 0

for i in range(n):
    for j in range(n):
        for k in range(n):
            if i < j < k and (L[i]+L[j] > L[k] and L[j]+L[k] > L[i] and L[k]+L[i] > L[j]) and (L[i] != L[j] and L[i] != L[k] and L[j] != L[k]):
                ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
A = list(map(int, input().split()))
 
seki_list = [0]*n
seki = 1
temp = 0

for i in range(n):
    seki *= A[i]
    seki_list[i] = seki

point = seki_list[k-1]

for i in range(k, n):
    temp = seki_list[i]/seki_list[i-k]
    if temp > point:
        print("Yes")
        point = temp
    else:
        print("No")
        point = temp

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

for i in range(k,n):
    if A[i] > A[i-k]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
A = list(map(int, input().split()))

seki_list = [0]*n
seki = 1
temp = 0

for i in range(n):
    seki *= A[i]
    seki_list[i] = seki

point = seki_list[k-1]

for i in range(k, n):
    temp = seki_list[i]/seki_list[i-k]
    if temp > point:
        print("Yes")
        point = temp
    else:
        print("No")
        point = temp


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

for i in range(k,n):
    if A[i] > A[i-k]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
A = list(map(int, input().split()))

seki_list = []
seki = 1
temp = 0

seki_list_append = seki_list.append

for i in A:
    seki *= i
    seki_list_append(seki)

point = seki_list[k-1]

for i in range(k, n):
    temp = seki_list[i]/seki_list[i-k]
    if temp > point:
        print("Yes")
        point = temp
    else:
        print("No")
        point = temp


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

for i in range(k,n):
    if A[i] > A[i-k]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
A = list(map(int, input().split()))


point = 1
for i in range(k):
    point *= A[i]
temp = 1

for i in range(k, n):
    for j in range(i-k+1, i+1):
        temp *= A[j]
    if temp > point:
        print("Yes")
        point = temp
        temp = 1
    else:
        print("No")
        point = temp
        temp = 1


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

for i in range(k,n):
    if A[i] > A[i-k]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

d = [0]*(n+1)

for i in range(1, n+1):
    for j in range(i, n+1, i):
        d[j] +=j

ans = sum(d)

print(ans)

Fixed submission:
n = int(input())

d = [0]*(n+1)

for i in range(1, n+1):
    for j in range(i, n+1, i):
        d[j] += j

ans = sum(d)

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

ans = 360//x
x = 360 % x

while x != 0:
    ans += 360//x
    x %= 360

print(ans)


Fixed submission:
x = int(input())

ans = 0

while True:
    ans += 1
    if ans*x % 360 == 0:
        break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans *= a[i]

if ans > 10**18:
    ans = -1

print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 in a:
    print(0)
    exit()

for i in a:
    ans *= i
    if ans > 10**18:
        print(-1)
        exit()

print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()
c=0
for x in n:
    if x=="7":
        print("Yes")
        c+=1
        break
    else:
        pass
if c=3:
    print("No")

Fixed submission:
n = input()
n_list = []
for i in n:
    n_list.append(i)

print("Yes") if n_list[0] == "7" or n_list[1] == "7" or n_list[2] == "7" else print("No")
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce


def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a % b)


def gcd(num):
    return reduce(euclid, num)


k = int(input())
ans = 0
i_list = []

for i1 in range(1, k+1):
    for i2 in range(1, k+1):
        for i3 in range(1, k+1):
            ans += gcd([i1, i2, i3])

print(ans)


Fixed submission:
from functools import reduce


def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a % b)


def gcd(num):
    return reduce(euclid, num)


k = int(input())
ans = 0
i_list = []

for i1 in range(1, k+1):
    for i2 in range(1, k+1):
        for i3 in range(1, k+1):
            ans += gcd([i1, i2, i3])

print(ans)
Buggy python submission (verdict: Runtime Error):
s = str(input())
if s[2] == s[3] and s[4] = s[5]:
    print("Yes")
else:
    print("No")


Fixed submission:
s = str(input())
if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")