Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a = int(input())
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if u==s:
    a-=1
if u==t:
    b-=1
print(a+' '+b)

Fixed submission:
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if u==s:
    a-=1
if u==t:
    b-=1
print(a,b)

Buggy python submission (verdict: Runtime Error):
a = int(input())
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if u==s:
    a-=1
if u==t:
    b-=1
print(a,b)

Fixed submission:
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if u==s:
    a-=1
if u==t:
    b-=1
print(a,b)

Buggy python submission (verdict: Runtime Error):
a = int(input())
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if u=s a-=1
if u=t b-=1
print(a b)

Fixed submission:
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if u==s:
    a-=1
if u==t:
    b-=1
print(a,b)
Buggy python submission (verdict: Runtime Error):
u = input()
for i in (len(u)-1):
    u[i]="x"
print(u)

Fixed submission:
t=input()
u=list(t)
for i in range(len(u)):
    u[i]="x"
    i+=1
t=''.join(u)
print (t)

Buggy python submission (verdict: Runtime Error):
u = input()
for i in len(u):
    u[i]="x"
print(u)

Fixed submission:
t=input()
u=list(t)
for i in range(len(u)):
    u[i]="x"
    i+=1
t=''.join(u)
print (t)

Buggy python submission (verdict: Runtime Error):
u = input()
for i in u.length:
    u[i]="x"
print(u)

Fixed submission:
t=input()
u=list(t)
for i in range(len(u)):
    u[i]="x"
    i+=1
t=''.join(u)
print (t)
Buggy python submission (verdict: Runtime Error):
import re

a = input()
if re.match(r'[a-z]', a) is not None:
	print 'a'
else:
	print 'A'

Fixed submission:
import re

a = input()
if re.match(r'[a-z]', a) is not None:
	print('a')
else:
	print('A')

Buggy python submission (verdict: Runtime Error):
a = input()
if re.match(r'[a-z]', a) :
	print 'a'
else:
	print 'A'

Fixed submission:
import re

a = input()
if re.match(r'[a-z]', a) is not None:
	print('a')
else:
	print('A')
Buggy python submission (verdict: Runtime Error):
a,b=input().split()
if a==b:
  print('Yes')
 else:
  print('No')

Fixed submission:
a,b=input().split()
if a==b:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
a,b=input().split()
if s==b:
  print('Yes')
 else:
  print('No')

Fixed submission:
a,b=input().split()
if a==b:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
from sys import stdin
n = int(stdin.readline().rstrip())
arr = stdin.readline().rstrip().split()
pre_num = arr.pop(0)
cnt = 0
max_cnt = 0
for i in arr:
  current_num = int(i)
  if pre_num >= current_num:
    cnt += 1
  else:
    if max_cnt < cnt:
      max_cnt = cnt
    cnt = 0
  pre_num = current_num
if max_cnt < cnt:
  max_cnt = cnt
print(max_cnt)


Fixed submission:
from sys import stdin
n = int(stdin.readline().rstrip())
arr = stdin.readline().rstrip().split()
pre_num = int(arr.pop(0))
cnt = 0
max_cnt = 0
for i in arr:
  current_num = int(i)
  if pre_num >= current_num:
    cnt += 1
  else:
    if max_cnt < cnt:
      max_cnt = cnt
    cnt = 0
  pre_num = current_num
if max_cnt < cnt:
  max_cnt = cnt
print(max_cnt)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
n = int(stdin.readline().rstrip())
arr = stdin.readline().rstrip().split()
pre_num = arr.pop(0)
cnt = 0
max_cnt = 0
for i in arr:
  current_num = int(i)
  if pre_num >= current_num:
    cnt += 1
  else:
    if max_cnt < cnt:
      max_cnt = cnt
    cnt = 0
  pre_num = current_num
if max_cnt < cnt:
  max_cnt = cnt
print(max_cnt)


Fixed submission:
from sys import stdin
n = int(stdin.readline().rstrip())
arr = stdin.readline().rstrip().split()
pre_num = int(arr.pop(0))
cnt = 0
max_cnt = 0
for i in arr:
  current_num = int(i)
  if pre_num >= current_num:
    cnt += 1
  else:
    if max_cnt < cnt:
      max_cnt = cnt
    cnt = 0
  pre_num = current_num
if max_cnt < cnt:
  max_cnt = cnt
print(max_cnt)
Buggy python submission (verdict: Runtime Error):
s, t = input()
print(t+s)

Fixed submission:
s, t = input().split()
print(t+s)

Buggy python submission (verdict: Runtime Error):
s, t = input()
print(t+s)

Fixed submission:
s, t = input().split()
print(t+s)
Buggy python submission (verdict: Runtime Error):
n = int(input)
for i in range(1, 10):
    for j in range(1, 10):
        if n == i * j:
            print('Yes')
            exit()

print('No')

Fixed submission:
n = int(input())
for i in range(1, 10):
    for j in range(1, 10):
        if n == i * j:
            print('Yes')
            exit()

print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
arr = [int(input() for i in range(N))]
print(sum(arr) - max(arr)//2)

Fixed submission:
N = int(input())
arr = [int(input()) for i in range(N)]
print(sum(arr) - max(arr)//2)
Buggy python submission (verdict: Runtime Error):
print(int(input)+1-int(input()))

Fixed submission:
n,i=map(int,input().split())
print(n+1-i)
Buggy python submission (verdict: Runtime Error):
arr = map(int, input().split())
print(max(arr) - min(arr))

Fixed submission:
arr = list(map(int, input().split()))
print(max(arr) - min(arr))

Buggy python submission (verdict: Runtime Error):
arr, =map(int, input().split())
print(max(arr) - min(arr))

Fixed submission:
arr = list(map(int, input().split()))
print(max(arr) - min(arr))
Buggy python submission (verdict: Runtime Error):
import sys

N, Y = map(int, input().split())
find_ans = False

for a in range(N+1):
    for b in range(N+1-a):
        c = N-a-b
        num = a*10000 + b*5000 + c*1000
        if num == Y:
            print(f"{a} {b} {c}")
            find_ans = True
            sys.exit()

if find_ans == False:
    print('-1 -1 -1')

Fixed submission:
import sys

N, Y = map(int, input().split())
find_ans = False

for a in range(N+1):
    for b in range(N+1-a):
        c = N-a-b
        num = a*10000 + b*5000 + c*1000
        if num == Y:
            print("{} {} {}".format(a, b, c))
            find_ans = True
            sys.exit()

if find_ans == False:
    print('-1 -1 -1')
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())

for op1 in '+-':
    for op2 in '+-':
        for op3 in '+-':
            if eval(A+op1+B+op2+C+op3+D) == 7:
                print(A+op1+B+op2+C+op3+D+'=7')
                exit()

Fixed submission:
A, B, C, D = map(str, input())

for op1 in '+-':
    for op2 in '+-':
        for op3 in '+-':
            if eval(A+op1+B+op2+C+op3+D) == 7:
                print(A+op1+B+op2+C+op3+D+'=7')
                exit()
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(b*2-a)

Fixed submission:
a = int(input())
b = int(input())
print(b*2-a)
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
s = [list(input()) for _ in range(H)]

for i in range(H):
    for j in range(W):
        if s[i][j] == '.':
            count = 0
            for dx, dy in (
                (-1,1), (0,1), (1,1),
                (-1,0), (0,0), (1,0),
                (-1,-1),(0,-1),(1,-1)
            ):
                now_x, now_y = i+dx, j+dy
                if s[now_x][now_y] == '#':
                    if 0 <= now_x and 0 <= now_y and now_x <= H-1 and now_y <= W-1:
                        count += 1
            s[i][j] = str(count)

for i in range(H):
    print(''.join(s[i]))

Fixed submission:
H, W = map(int, input().split())
s = [list(input()) for _ in range(H)]

for i in range(H):
    for j in range(W):
        if s[i][j] == '.':
            count = 0
            for dx, dy in (
                (-1,1), (0,1), (1,1),
                (-1,0), (0,0), (1,0),
                (-1,-1),(0,-1),(1,-1)
            ):
                now_x, now_y = i+dx, j+dy
                if 0 <= now_x and 0 <= now_y and now_x <= H-1 and now_y <= W-1 and s[now_x][now_y] == "#":
                    count += 1
            s[i][j] = str(count)

for i in range(H):
    print(''.join(s[i]))
Buggy python submission (verdict: Runtime Error):
for _ in range(int(input())):
    print(sum(1-eval(input().replace(" ","-"))))

Fixed submission:
print(sum(1-eval(input().replace(" ","-")) for _ in range(int(input()))))
Buggy python submission (verdict: Runtime Error):
n, l, t = map(int, input().split())

arr = []
for i in range(n):
    x, w = map(int, input().split())

    if w == 1:
        arr.append((x+t) % l)
        s += (x+t) // l
    else: # W == 2:
        arr.append((x-t) % l)
        s += (x-t) // l

arr.sort()
s %= n
arr = arr[s:] + arr[:s]
print(*[i for i in arr], sep='\n')

Fixed submission:
n, l, t = map(int,input().split())

c = []
s = 0

for i in range(n):
    x, w = map(int,input().split())
    if w == 1:
        c.append((x+t)%l)
        s += (x+t)//l
    else: # w == 2
        c.append((x-t)%l)
        s += (x-t)//l

c.sort()
s %= n
c = c[s:] + c[:s]
print(*[i for i in c], sep='\n')
Buggy python submission (verdict: Runtime Error):
a, b = input()
print('DH'[a==b])

Fixed submission:
a, b = input().split()
print('DH'[a==b])
Buggy python submission (verdict: Runtime Error):
N = int(input())
num = 1
for i in range(1, N+1):
    num *= i
    num %= 1_000_000_007
print(num)

Fixed submission:
N = int(input())
num = 1
for i in range(1, N+1):
    num *= i
    num %= 1000000007
print(num)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

count = 0
for x in range(0, K+1):
    for y in range(0, K+1):
        for z in range(0, K+1):
            if x + y + z == S:
                count += 1

print(count)

Fixed submission:
K, S = map(int, input().split())

count = 0
for X in range(K+1):
    for Y in range(K+1):
        if 0 <= (S-X-Y) <= K:
            count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))

from functools import reduce
import fraction 


A.sort(reverse = True)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

print(gcd_list(A))


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

from functools import reduce
import fractions 


A.sort(reverse = True)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

print(gcd_list(A))

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))

from functools import reduce
import math 


A.sort(reverse = True)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

print(gcd_list(A))


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

from functools import reduce
import fractions 


A.sort(reverse = True)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

print(gcd_list(A))
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

#print(s)
#print(t)

n = len(s)

dic = {}
dic2 = {}


for i in range(n):
    if s[i] in dic:
        if dic[s[i]] != t[i]:
            print("No")
            sys.exit()
            
    else:
        dic[s[i]] = t[i]
            
            
    if t[i] in dic2:
        if dic2[t[i]] != s[i]:
            print("No")
            sys.exit()
            
    else:
        dic2[t[i]] = s[i]
        
print("Yes")
        


Fixed submission:
import sys

s = input()
t = input()

#print(s)
#print(t)

n = len(s)

dic = {}
dic2 = {}


for i in range(n):
    if s[i] in dic:
        if dic[s[i]] != t[i]:
            print("No")
            sys.exit()
            
    else:
        dic[s[i]] = t[i]
            
            
    if t[i] in dic2:
        if dic2[t[i]] != s[i]:
            print("No")
            sys.exit()
            
    else:
        dic2[t[i]] = s[i]
        
print("Yes")

Buggy python submission (verdict: Runtime Error):
s = list(input())
t = list(input())

#print(s)
#print(t)

n = len(s)

dic = {}
dic2 = {}

if s == t:
    print("Yes")

else:
    for i in range(n):
        if s[i] in dic:
            if dic[s[i]] != t[i]:
                print("No")
                sys.exit()

        else:
            dic[s[i]] = t[i]

        
        if t[i] in dic2:
            if dic2[t[i]] != s[i]:
                print("No")
                sys.exit()

        else:
            dic2[t[i]] = s[i]

print("Yes")


Fixed submission:
import sys

s = input()
t = input()

#print(s)
#print(t)

n = len(s)

dic = {}
dic2 = {}


for i in range(n):
    if s[i] in dic:
        if dic[s[i]] != t[i]:
            print("No")
            sys.exit()
            
    else:
        dic[s[i]] = t[i]
            
            
    if t[i] in dic2:
        if dic2[t[i]] != s[i]:
            print("No")
            sys.exit()
            
    else:
        dic2[t[i]] = s[i]
        
print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())

ans = []

for i in range(b - a + 1):
    n = a + i
    if n <= a + k - 1 or n >= b - k + 1:
        ans.append(n)

ans.sort()
for i in range(len(ans)):
    print(ans[i])


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

ans = []

for i in range(k):
    if a + i <= b and a <= b - i:
        ans.append(a + i)
        ans.append(b - i)

#ans.sort()
ans = set(ans)

for i in sorted(ans):
    print(i)
Buggy python submission (verdict: Runtime Error):
n = int(input())

ntmp = n
sum = 0

while ntmp >= 10:
    sum += ntmp % 10
    ntmp = ntmp // 10

if n % sum == 0:
    print("Yes")

else:
    print("No")


Fixed submission:
n = int(input())

ntmp = n
sum = 0

while True:
    sum += ntmp % 10
    ntmp = ntmp // 10
    if ntmp == 0:
        break

if n % sum == 0:
    print("Yes")

else:
    print("No")

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

ntmp = n
sum = 0

while ntmp >= 10:
    sum += ntmp % 10
    ntmp = (int)(ntmp / 10)

if n % sum == 0:
    print("Yes")

else:
    print("No")


Fixed submission:
n = int(input())

ntmp = n
sum = 0

while True:
    sum += ntmp % 10
    ntmp = ntmp // 10
    if ntmp == 0:
        break

if n % sum == 0:
    print("Yes")

else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())

ko = [0 for _ in range(100000)]

a = [int(input()) for _ in range(n)]

for i in range(n):
    ko[a[i]] += 1

ko = list(filter(lambda x: x%2 == 1, ko))

#print(ko)

print(len(ko))


Fixed submission:
n = int(input())

a = [int(input()) for _ in range(n)]

if len(a) == 1:
    print(1)
    exit(0)

a.sort()
ans = 0

prev = a[0]
tmp = 0

for i in range(n):
    if a[i] != prev:
        if tmp % 2 == 1:
            ans += 1

        tmp = 1

    else:
        tmp += 1

    prev = a[i]

if tmp % 2 == 1:
    ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
n, p = map(int, input().split())

a = list(input())

for i in len(a):
    if i % 2 == 1:
        print(2 ** (n - 1))
        exit(0)

if p == 0:
    print(2 ** n)

else:
    print(0)


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

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

#print(a)

for i in a:
    if i % 2 == 1:
        print(2 ** (n - 1))
        exit(0)

if p == 0:
    print(2 ** n)

else:
    print(0)

Buggy python submission (verdict: Runtime Error):
n, p = map(int, input().split())

a = list(input())

for i in a:
    if i % 2 == 1:
        print(2 ** (n - 1))
        exit(0)

if p == 0:
    print(2 ** n)

else:
    print(0)


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

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

#print(a)

for i in a:
    if i % 2 == 1:
        print(2 ** (n - 1))
        exit(0)

if p == 0:
    print(2 ** n)

else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())

l = []

for i in range(n):
    a, b = map(int, input().split())
    for j in range(b):
        l.append(a)

    
l.sort()

print(l[k-1])


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

l = [0 for _ in range(1000000)]

rui = 0

for i in range(n):
    a, b = map(int, input().split())
    l[a] += b


for i in range(len(l)):
    rui += l[i]

    if rui >= k:
        print(i)
        break

#print()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

power = 1

p = 1000000000 + 7

for i in range(n):
    power *= (i + 1)

print(power % p)


Fixed submission:
n = int(input())

power = 1

p = 1000000000 + 7

for i in range(n):
    power = power * (i + 1) % p

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


if x < 1200:
    print("ABC")

else:
    print("ARC")


Fixed submission:
x = int(input())


if x < 1200:
    print("ABC")

else:
    print("ARC")
Buggy python submission (verdict: Runtime Error):
s = input()

ans = []
flag = 0

#print(s)
#print(s[0])

for i in range(len(s)):
    if flag == 0:
        if s[i] == "A":
            flag = 1
            ans.append(s[i])

    else:
        if s[i] == "Z":
            if s[i+1] != "Z":
                flag = 0
                ans.append(s[i])
                break
            
            else:
                ans.append(s[i])

        else:
            ans.append(s[i])
        

#print(ans)

#print("".join(ans))

print(len(ans))


Fixed submission:
s = input()

flag = 0

a = 200000
z = 0

for i in range(len(s)):
    if s[i] == "A" and a > i:
        a = i

    elif s[i] == "Z" and z < i:
        z = i

print(z - a + 1)

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

ans = []
flag = 0

#print(s)
#print(s[0])

for i in range(len(s)):
    if flag == 0:
        if s[i] == "A":
            flag = 1
            ans.append(s[i])

    else:
        if s[i] == "Z":
            if i > len(s) - 1 or s[i+1] != "Z":
                flag = 0
                ans.append(s[i])
                break
            
            else:
                ans.append(s[i])

        else:
            ans.append(s[i])
        

#print(ans)

#print("".join(ans))

print(len(ans))


Fixed submission:
s = input()

flag = 0

a = 200000
z = 0

for i in range(len(s)):
    if s[i] == "A" and a > i:
        a = i

    elif s[i] == "Z" and z < i:
        z = i

print(z - a + 1)
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())

ans = 0

for i in range(k + 1):
    for j in range(k + 1):
        for h in range(k + 1):
            if h + i + j == s:
                ans += 1

print(ans)


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

ans = 0

for i in range(k + 1):
    for j in range(k + 1):
        z = s - i - j
        if 0 <= z <= k:
            ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int, input().split())

ans = 0

for i in range(b - a + 1):
    if((a + i) % x) == 0:
        ans = ans + 1


print(ans)


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

def func(n):
    if n == -1:
        return 0

    else:
        return n // x + 1

print(func(b) - func(a - 1))
Buggy python submission (verdict: Runtime Error):
count = {'AC' : 0,'WA' : 0,'TLE': 0,'RE' : 0 }
n = int(input)
for i in range(0,n):
  count[input()]+=1
ptrint('AC x '+str(count['AC']))
ptrint('WA x '+str(count['WA']))
ptrint('TLE x '+str(count['TLE']))  
ptrint('RE x '+str(count['RE']))

Fixed submission:
N = int(input())
S = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for i in range(N):
    S[input()] += 1
for a in S:
    print(a + " x " + str(S[a]))

Buggy python submission (verdict: Runtime Error):
count = {'AC' : 0,'WA' : 0,'TLE': 0,'RE' : 0 }
n = int(input)
for i in range(0,n):
  count[input()]+=1
ptrint('AC x '+count['AC'])
ptrint('WA x '+count['WA'])
ptrint('TLE x '+count['TLE'])  
ptrint('RE x '+count['RE'])

Fixed submission:
N = int(input())
S = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for i in range(N):
    S[input()] += 1
for a in S:
    print(a + " x " + str(S[a]))
Buggy python submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
for i in range(1, N): A[i] += A[i - 1]
for i in range(1, M): B[i] += B[i - 1]
ans, j = 0, M - 1
for i in range(N):
    if A[i] > K: break
    while B[j] > K - A[i]: j -= 1
    ans = max(ans, i + j + 2)
    j = M - 1
print(ans)


Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0], [0]
for i in range(N):
	a.append(a[i] + A[i])
for i in range(M):
	b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
	if a[i] > K: break
	while b[j] > K - a[i]: j -= 1
	ans = max(ans, i + j)
print(ans)

Buggy python submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
for i in range(1, N): A[i] += A[i - 1]
for i in range(1, M): B[i] += B[i - 1]
print(A)
print(B)
ans, j = 0, M - 1
for i in range(N):
    if A[i] > K: break
    while B[j] > K - A[i]: j -= 1
    ans = max(ans, i + j + 2)
    j = M - 1
print(ans)


Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0], [0]
for i in range(N):
	a.append(a[i] + A[i])
for i in range(M):
	b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
	if a[i] > K: break
	while b[j] > K - a[i]: j -= 1
	ans = max(ans, i + j)
print(ans)

Buggy python submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
for i in range(1, N): A[i] += A[i - 1]
for i in range(1, M): B[i] += B[i - 1]
ans, j = 0, M - 1
for i in range(N):
    if A[i] > K: break
    while B[j] > K - A[i]: j -= 1
    ans = max(ans, i + j + 2)
print(ans)

Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0], [0]
for i in range(N):
	a.append(a[i] + A[i])
for i in range(M):
	b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
	if a[i] > K: break
	while b[j] > K - a[i]: j -= 1
	ans = max(ans, i + j)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
sum = eval(input().replace(' ','*'))
print(sum if sum<= 10**18 else -1)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
res = 1
for i in A:
    res*=i;
    if res>10**18:
        res = -1
        break
print(res)

Buggy python submission (verdict: Runtime Error):
N = int(input())
sum = eval(input().replace(' ','*'))
print(sum if sum<= 10**8 else -1)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
res = 1
for i in A:
    res*=i;
    if res>10**18:
        res = -1
        break
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

N = int(input())

ans = 0
for i in range(1,N):
    ans += i

print(ans)


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

N = int(input())

ans = (1+(N-1))*(N-1)//2

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
dp=[0]*n
dp[0]=0
dp[1]=abs(h[1]-h[0])
dp[2]=min(abs(h[1]-h[0]),abs(h[2]-h[0]))
for i in range(2,n):
    dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))
print(dp[n-1])


Fixed submission:
n=int(input())
h=list(map(int,input().split()))
dp=[0]*n
dp[0]=0
dp[1]=abs(h[1]-h[0])
for i in range(2,n):
  dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))
print(dp[n-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
dp=[0]*n
dp[0]=0
dp[1]=abs(h[1]-h[0])
dp[2]=min(abs(h[1]-h[0]),abs(h[2]-h[0]))
for i in range(3,n):
    dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))
print(dp[n-1])


Fixed submission:
n=int(input())
h=list(map(int,input().split()))
dp=[0]*n
dp[0]=0
dp[1]=abs(h[1]-h[0])
for i in range(2,n):
  dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))
print(dp[n-1])
Buggy python submission (verdict: Runtime Error):
import numpy as np


a = input()

part = ""
s = ["A","C","G","T"]
ans = []

for i in a:
    if  i not in s:
        ans.append(part)
        part = ""
    else:
        part += i


print(len(max(ans)))

Fixed submission:
a = input()

part = ""
s = ["A","C","G","T"]
ans = [""]

for i in a:
    
    if  i  in s:
        part += i
    else:
        part = ""
    ans.append(part)
ans = [len(i) for i in ans]
print(max(ans))