Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02760 (python)

Fixed submission:
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
n = int(input())
c = "check"
for i in range(n):
    v = int(input())
    ind = 0
    if v in a1 :
        ind = a1.index(v)
        a1[ind] = c
    if v in a2 :
        ind = a2.index(v)
        a2[ind] = c
    if v in a3 :
        ind = a3.index(v)
        a3[ind] = c

if ((a1[0] == c and a2[0] == c and a3[0] == c) or  
    (a1[1] == c and a2[1] == c and a3[1] == c) or 
    (a1[2] == c and a2[2] == c and a3[2] == c) or 
    (a1[0] == c and a2[1] == c and a3[2] == c) or
    (a1[2] == c and a2[1] == c and a3[0] == c) or
    a1.count(c) == 3 or
    a2.count(c) == 3 or
    a3.count(c) == 3):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
n = int(input())
c = "check"
for i in range(n):
    v = int(input())
    ind = 0
    if v in a1 :
        ind = a1.index(v)
        a1[ind] = c
    if v in a2 :
        ind = a2.index(v)
        a2[ind] = c
    if v in a3 :
        ind = a3.index(v)
        a3[ind] = c

if ((a1[0] == c and a2[0] == c and a3[0] == c) or  
    (a1[1] == c and a2[1] == c and a3[1] == c) or 
    (a1[2] == c and a2[2] == c and a3[2] == c) or 
    (a1[0] == c and a2[1] == c and a3[2] == c) or
    (a1[2] == c and a2[1] == c and a3[3] == c) or
    a1.count(c) == 3 or
    a2.count(c) == 3 or
    a3.count(c) == 3):
    print("Yes")
else:
    print("No")
Problem p02801 (python)

Fixed submission:
c = input()
dic = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
ind = dic.index(c)
print(dic[ind+1])

Buggy submission (verdict: Runtime Error):
c = input()
dic = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y']
ind = dic.index(c)
print(dic[ind+1])
Problem p02898 (python)

Fixed submission:
n,k = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for i in range(len(a)):
    if a[i] >= k:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
a = list(map(int, input(),split()))
ans = 0
for i in range(len(a)):
    if a[i] >= k:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
a = list(map(int, input(),split()))
ans = 0
for i in range(len(a):
    if a[i] >= k:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
a = list(map(int, input(),split()))
ans = 0
for i in range(len(a):
    if a[i] >= k:
        ans += 1
print(ans)
Problem p03220 (python)

Fixed submission:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
gap = float("inf")
for i in range(n):
    if abs(t - h[i] * 0.006 - a) < gap:
        ans = i + 1
        gap = abs(t - h[i] * 0.006 - a)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
gap = float("")
for i in range(n):
    print(gap)
    if abs(t - h[i] * 0.006 - a) < gap:
        ans = i + 1
        gap = abs(t - h[i] * 0.006 - a)
print(ans)
Problem p03352 (python)

Fixed submission:
x = int(input())
ans = 1
for i in range(1, 32):
    for j in range(2, 10):
        p = pow(i, j)
        if p > x:
            break
        if p > ans:
            ans = p
print(ans)

Buggy submission (verdict: Runtime Error):
x = int(input())
ans = 0
lis = []
for i in range(1, x + 1):
    for j in range(2, x+1):
        ans = i ** j
        if ans <= x:
            lis.append(ans)
print(lis[-1])
Problem p03386 (python)

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

for i in range(a, min(b +1, a+k)):
    print(i)
for i in range(max(a+k, b-k+1), b+1):
    print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
lis = list(range(a, b+1))
ans = []
for i in range(k):
    if a + i <= b:
        ans.append(a + i)
    if b - i >= a:
        ans.append(b - i)

for i in sorted(set(ans)):
    print(i)
Problem p03738 (python)

Fixed submission:
a = int(input())
b = int(input())
if a < b:
    print("LESS")
elif a > b:
    print("GREATER")
else:
    print("EQUAL")

Buggy submission (verdict: Runtime Error):
a = int(input)
b = int(input)
if a < b:
    print("LESS")
elif a > b:
    print("GREATER")
else:
    print("EQUAL")
Problem p02761 (python)

Fixed submission:
def main():
    n, m = [int(i) for i in input().split()]
    # digits = [(int(i) for i in input().split()) for _ in range(m)]
    digits = [-1] * n
    for i in range(m):
        s, c = [int(i) for i in input().split()]
        if not digits[s-1] in (-1, c):
            print(-1)
            return

        digits[s-1] = c

    top = True
    for i in range(n):
        d = digits[i]
        if top:
            if d == 0:
                if i+1 < n:
                    print(-1)
                    return
                top = False
            if d == -1:
                digits[i] = 0
            else:
                top = False
        else:
            if d == -1:
                digits[i] = 0

    t = str(int("".join([str(i) for i in digits])))
    if len(t) == n:
        print(t)
    else:
        s = [str(i) for i in digits]
        s[0] = "1" if n > 1 else "0"
        print("".join(s))

main()

Buggy submission (verdict: Runtime Error):
def main():
    n, m = [int(i) for i in input().split()]
    # digits = [(int(i) for i in input().split()) for _ in range(m)]
    digits = [-1] * 3
    for i in range(m):
        s, c = [int(i) for i in input().split()]
        if not digits[s-1] in (-1, c):
            print(-1)
            return

        digits[s-1] = c

    top = True
    for i in range(n):
        d = digits[i]
        if top:
            if d == 0:
                if i+1 < n:
                    print(-1)
                    return
            if d == -1:
                digits[i] = 0
                continue
            else:
                top = False
        else:
            if d == -1:
                digits[i] = 0

    print(int("".join([str(i) for i in digits])))

main()
Problem p02900 (python)

Fixed submission:
A, B = sorted([int(i) for i in input().split()])

res = 1
for i in range(2, int(B**0.5)+1):
    if B % i == 0:
        if A % i == 0:
            for j in range(2, int(i**0.5)+1):
                if i % j == 0:
                    break
            else:
                res += 1
        t = B // i
        if t != i and A % t == 0:
            for j in range(2, int(t**0.5)+1):
                if t % j == 0:
                    break
            else:
                res += 1

print(res if res > 1 else (1 if (A == B == 1) or A != B else 2))

Buggy submission (verdict: Runtime Error):
def common_divisor(a, b):
    # a <= b
    res = []
    for i in range(2, int(a**0.5)+1):
        if a % i == 0 and b % i == 0:
            res.append(i)
            t = a // i
            if i != t and b % t == 0:
                res.append(t)
    return sorted(res)

def primes_num(arr):
    res = 0
    TESU = int(arr[-1]**0.5)+1
    for i in arr:
        flg = True
        rt_i = i**0.5
        for j in range(2, TESU):
            if rt_i < j:
                break
            elif i % j == 0:
                flg = False
                break
        if flg: res += 1
    return res

A, B = sorted([int(i) for i in input().split()])
# A <= B

cds = common_divisor(A, B)
print(primes_num(cds)+1)
Problem p02947 (python)

Fixed submission:
N = int(input())
d = dict()

for _ in range(N):
    s = "".join(sorted(input()))
    if s in d:
        d[s] += 1
    else:
        d[s] = 0

print(int(sum(map(lambda x: (x+1)*x/2, d.values()))))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = []
for _ in range(N):
    s = [0]*26
    for i in map(lambda: ord(c)-97, input()):
        s[i] += 1

res = 0
for i in range(N):
    for j in range(i+1, N):
        if S[i] == S[j]:
            res += 1

print(res)
Problem p02995 (python)

Fixed submission:
A, B, C, D = [int(i) for i in input().split()]

def lcm(a, b):
    ori_a, ori_b = a, b
    if a > b: a, b = b, a
    while True:
        a, b = b%a, a
        if a == 0:
            g = b
            break
        elif a == 1:
            g = 1
            break

    return ori_a // g * ori_b

S1 = A - ( A//C + A//D - A//lcm(C, D) ) - (1 if A%C and A%D else 0)
S2 = B - ( B//C + B//D - B//lcm(C, D) )

print(S2 - S1)

Buggy submission (verdict: Runtime Error):
from math import gcd

A, B, C, D = [int(i) for i in input().split()]

def lcm(a, b):
    return a // gcd(a, b) * b

S1 = A - ( A//C + A//D - A//lcm(C, D) ) - (1 if A%C and A%D else 0)
S2 = B - ( B//C + B//D - B//lcm(C, D) )

print(S2 - S1)
Problem p02628 (python)

Fixed submission:
def addAndDeleteMin():
	global ans
	global p
	minv = min(p)
	ans += minv
	p.remove(minv)

n,k = map(int,input().split())
p = [int(x) for x in input().split()]
ans = 0
for i in range(k):
	addAndDeleteMin()
print(ans)

Buggy submission (verdict: Runtime Error):
def processValue(array:list):
	global minimumValue
	value = 0
	for i in array:
		value += fruits[i]
	
	if minimumValue == -1 or value < minimumValue:
		minimumValue = value

def combi(n,k,i,array):
	if i == k:
		processValue(array)
		return
	for j in range(array[i-1],n):
		if j in array[0:i]:
			continue
		array[i] = j
		combi(n,k,i+1,array)

fruits = []
minimumValue = -1
n,k = map(int,input().split())
fruits = [int(f) for f in input().split()]
combi(n,k,0,[0 for _ in range(k)])
print(minimumValue)

Buggy submission (verdict: Runtime Error):
fruits = []
minimumValue = -1

def processValue(array:list):
	global minimumValue
	value = 0
	for i in array:
		value += fruits[i]
	
	if minimumValue == -1 or value < minimumValue:
		minimumValue = value

def combi(n,k,i,array):
	if i == k:
		processValue(array)
		return
	for j in range(array[i-1],n):
		if j in array[0:i]:
			continue
		array[i] = j
		combi(n,k,i+1,array)

n,k = map(int,input().split())
fruits = [int(f) for f in input().split()]
combi(n,k,0,[0 for _ in range(k)])
print(minimumValue)

Buggy submission (verdict: Runtime Error):
fruits = []
minimumValue = -1

def processValue(array:list):
	global minimumValue
	value = 0
	for i in array:
		value += fruits[i]
	
	if minimumValue == -1 or value < minimumValue:
		minimumValue = value

def combi(n,k,i,array):
	if i == k:
		processValue(array)
		return
	for j in range(array[i-1],n):
		if j in array[0:i]:
			continue
		array[i] = j
		combi(n,k,i+1,array)

def main():
	global fruits
	global minimumValue
	n,k = map(int,input().split())
	fruits = [int(f) for f in input().split()]
	combi(n,k,0,[0 for _ in range(k)])
	print(minimumValue)

main()
Problem p03086 (python)

Fixed submission:
def f(x):
    length=0
    array=[]
    for b in x:
        if b==True:
            length+=1
        else:
            array.append(length)
            length=0

    array.append(length)
    return array

s=input()
sb = ['A','C','G','T']
boola=list()
length=0

for x in s:
    boola.append(x in sb)

print(max(f(boola)))

Buggy submission (verdict: Runtime Error):
def f(x):
    length=0
    array=[]
    for b in x:
        if b==True:
            length+=1
        else:
            array.append(length)
            length=0

    return array

s=input()
sb = ['A','C','G','T']
boola=list()
length=0

for x in s:
    boola.append(x in sb)

print(max(f(boola)))
Problem p03106 (python)

Fixed submission:
A,B,K = map(int,input().split())
d=[]
if(A>B):
    M=A
    m=B
else:
    M=B
    m=A

for x in range(m,0,-1):
    if(m%x ==0 and M%x ==0):
       d.append(x) 

print(d[K-1])

Buggy submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
if(B>A):
  A,B=B,A
divisor = [x for x in range(B,0,-1) if (A%x==0 and B%x==0)]
print(divisor[K+1])
Problem p03125 (python)

Fixed submission:
A,B=map(int,input().split())
if(A>0 and B%A==0):
  print(B+A)
else:
  print(B-A)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if(A>0 and B%A==0):
  print(B+A)
else:
  print(B-A)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if(A>0 & B%A==0):
  print(B+A)
else:
  print(B-A)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if(A>0 && B%A==0):
  print(B+A)
else:
  print(B-A)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
if(A>0 && B%A==0):
  print(B+A)
else:
  print(B-A)

Buggy submission (verdict: Runtime Error):
A B = map(int(),input().split())
if(A>0 && B%A==0):
  print(B+A)
else:
  print(B-A)

Buggy submission (verdict: Runtime Error):
A B = map(int(),input().split())
if(B%A==0):
  print(B+A)
else:
  print(B-A)
Problem p03126 (python)

Fixed submission:
import sys

N,M = map(int,input().split())
member = dict()
for i in range(1,N+1,1):
    ilist = list(map(int,input().split()))
    ilist.pop(0)
    member[i]=set(ilist)

match_set=member[1]

for i in range(2,N+1,1):#memberに対し、1人ずつ検査していく
    match_set = match_set & member[i]

print(len(match_set))

Buggy submission (verdict: Runtime Error):
import sys

N,M = map(int,input().split())
member = dict()
for i in range(1,N+1,1):
    ilist = list(map(int,input().split()))
    ilist.pop(0)
    member[i]=set(ilist)

if(N==1):
    print(member(1))
    sys.exit(0)

match_set=member[1]
for i in range(2,N+1,1):#memberに対し、1人ずつ検査していく
    match_set = match_set & member[i]

print(len(match_set))

Buggy submission (verdict: Runtime Error):
import sys

N,M = map(int,input().split())
member = dict()
for i in range(1,N+1,1):
    j=int(input())
    member[i] = set(int(input()) for _ in range(j))
if(N==1):
    print(member(1))
    sys.exit(0)

match_set=member[1]
for i in range(2,N+1,1):#memberに対し、1人ずつ検査していく
    match_set = match_set & member[i]

print(match_set.length)
Problem p02657 (python)

Fixed submission:
A, B = map(int, input().split())
print(A*B)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print(A*B)

Buggy submission (verdict: Runtime Error):
def main():
    A = int(input())
    B = int(input())
    ans = a(A, B)
    print(ans)

def a(A, B):
    return (A * B)

main()

Buggy submission (verdict: Runtime Error):
def a(A B)
	return A * B
Problem p02658 (python)

Fixed submission:
import sys
N = int(input())
A = list(map(int, input().split()))
if 0 in A:
    print(0)
    sys.exit()
B = 1
for i in A:
    B = B * i
    if B > 10 ** 18:
        print(-1)
        sys.exit()
print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
if 0 in A:
    print(0)
    return
B = 1
for i in A:
    B = B * i
    if B >= 10 ** 18:
        print(-1)
        return
print(B)

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
A = list(map(int, input().split()))
B = 1
for i in A:
    B = B * i
    if B >= 10 ** 18
        print(-1)
        sys.exit()
print(B)

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
A = list(map(int, input().split()))
for i in A:
    B = 1
    B = B * A[i]
    if B >= 10 ** 18
        print(-1)
        sys.exit()
print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
for i in A:
    B = B * A[i]
    if B >= 1000000000000000000
        return print(-1)
print(B)
Problem p02600 (python)

Fixed submission:
N = int(input().strip())

if N<=599:print(8)
elif N<=799:print(7)
elif N<=999:print(6)
elif N<=1199:print(5)
elif N<=1399:print(4)
elif N<=1599:print(3)
elif N<=1799:print(2)
else: print(1)

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input().strip().split()))
A = list(map(int, input().strip().split()))

import numpy as np

Base = np.prod(A[:K])
for n in range(N-K):
  Tgt_i = np.prod(A[n:K+n])
  Tgt_i1 = np.prod(A[n+1:K+n+1])
  if Tgt_i < Tgt_i1:
    print('Yes')
  else:
    print('No')
Problem p02602 (python)

Fixed submission:
N, K = list(map(int, input().strip().split()))
A = list(map(int, input().strip().split()))

if N == K:
  print('No')
else:
  for n in range(N-K):
    Tgt1 = A[n]
    Tgt2 = A[K+n]
    if Tgt1 < Tgt2:
      print('Yes')
    else:
      print('No')

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input().strip().split()))
A = list(map(int, input().strip().split()))

for n in range(N-K):
  Tgt1 = A[n]
  Tgt2 = A[K+n+1]
  if Tgt1 < Tgt2:
    print('Yes')
  else:
    print('No')
Problem p02639 (python)

Fixed submission:
l = list(map(int, input().strip().split()))

idx = None
for i in range(len(l)):
  if l[i] == 0:
    idx = i+1
print(idx)

Buggy submission (verdict: Runtime Error):
N = int(input().strip())
A = list(map(int, input().strip().split()))
 
count = 0
 
for n in range(N):
  flg = True
  if A.count(A[n]) == 1:
    tmp = [a for a in A if a != A[n]]
    for m in tmp:
      if A[n]%m == 0: flg = False
  else: flg = False
  
  if flg == True: count += 1
    
print(count)
Problem p02658 (python)

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

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
 
A.sort()
rslt = A[0]
 
for a in A[1:]:
  result *= a
  if rslt > 10**18:
    print(-1)
    exit()
print(rslt)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
 
A.sort()
rslt = a[0]

for a in A[1:]:
  result *= a
  if rslt > 10**18:
    print(-1)
    exit()
print(rslt)

Buggy submission (verdict: Runtime Error):
N = input().strip()
A = [input().strip() for i in range(N)]

r = A[0]
for i in range(1,N):
  r *= A[i]

if r > 10**8: r = -1

  
r = int(r)
print(r)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
c = (a * b) % 2
if c == 0:
	print('Even')
else:
	print('Odd')

Buggy submission (verdict: Runtime Error):
a, b = list(map(int, input().strip().split()))
c = a*b
if c%2 = 0:
  print('Even')
else:
  print('Odd')
Problem p03494 (python)

Fixed submission:
N = int(input())
 
l = list(map(int, input().strip().split()))
 
count = 0
 
while all([a == 0 for a in list(map(lambda x: x%2, l))]):
    l = list(map(lambda x: x/2, l))
    count += 1
    
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
 
l = [int(input()) for _ in range(N)]
 
count = 0

while all([a == 0 for a in list(map(lambda x: x%2, l))]):
    l = list(map(lambda x: x/2, l))
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input().strip())

l = [_ for _ in int(input().strip())]

count = 0

while all([a == 0 for a in list(map(lambda x: x%2, l))]):
    l = list(map(lambda x: x/2, l))
    count += 1

print(count)
Problem p02717 (python)

Fixed submission:
#ab,ac
a,b,c = map(int,input().split())
a,b = b,a
a,c = c,a
print(a,b,c)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
print(min(n%k,abs(k-n%k)))

Buggy submission (verdict: Runtime Error):
import math
n,k = map(int,input().split())
print(min(n%k,k-n%k))

Buggy submission (verdict: Runtime Error):
import math
n,k = map(int,input().split())
x = n//k
if(n<k):
    x = k//n
    print(min(abs(k*x-n),abs(k*(x+1)-n)))
else:
    print(min(abs(k*x-n),abs(k*(x+1)-n)))

Buggy submission (verdict: Runtime Error):
import math
n,k = map(int,input().split())
x = math.ceil(n/k)
if(n<k):
    x = math.ceil(n/k)
    print(min(n,abs(k*x-n)))
else:
    print(abs(k*x-n))
Problem p02719 (python)

Fixed submission:
n,k = map(int,input().split())
print(min(n%k,abs(k-n%k)))

Buggy submission (verdict: Runtime Error):
import math
n,k = map(int,input().split())
x = n//k
if(n<k):
    x = k//n
    print(min(abs(k*x-n),abs(k*(x+1)-n)))
else:
    print(min(abs(k*x-n),abs(k*(x+1)-n)))

Buggy submission (verdict: Runtime Error):
import math
n,k = map(int,input().split())
x = n//k
if(n<k):
    x = k//n
    print(min(abs(k*x-n),abs(k*(x+1)-n)))
else:
    print(min(abs(k*x-n),abs(k*(x+1)-n)))
Problem p02999 (python)

Fixed submission:
x,a = list(map(int,input().split()))
if(x<a):
    print(0)
else:
    print(10)

Buggy submission (verdict: Runtime Error):
import itertools 
n,x = list(map(int,input().split()))
l = list(map(int,input().split()))
k = list(itertools.accumulate(l))
k.sort()
s = 0
ii = 0

for i in k:
    if(i<=x):
        continue
    else:
        s = ii
        ii+=1
        break
if(s==0):
    print(n)
else:
    print(max(1,s+1))
Problem p03078 (python)

Fixed submission:
x, y, z, k = map(int, input().split())
m = []
for _ in range(3):
    m.append(sorted(list(map(int, input().split())), reverse=True))

def sorted_sum(list_a, list_b, limit):
    s = []
    for x in list_a:
        for y in list_b:
            s.append(x + y)
    return sorted(s, reverse=True)[0:limit]


def consume_diff(s, a_val, list_b, b_index):
    diff = a_val - list_b[b_index]
    for i in range(b_index + 1, len(list_b)):
        if list_b[b_index] - list_b[i] > diff:
            break
        s.append(a_val + list_b[i])



ans = sorted_sum(sorted_sum(m[0], m[1], k), m[2], k)
for i in range(min([k, len(ans)])):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
x, y, z, k = map(int, input().split())
m = []
for _ in range(3):
    m.append(sorted(list(map(int, input().split())), reverse=True))

def sorted_sum(list_a, list_b, limit):
    s = []
    for x in list_a:
        for y in list_b:
            s.append(x + y)
    return sorted(s[0:limit], reverse=True)


def consume_diff(s, a_val, list_b, b_index):
    diff = a_val - list_b[b_index]
    for i in range(b_index + 1, len(list_b)):
        if list_b[b_index] - list_b[i] > diff:
            break
        s.append(a_val + list_b[i])



ans = sorted_sum(sorted_sum2(m[0], m[1], k), m[2], k)
for i in range(min([k, len(ans)])):
    print(ans[i])
Problem p02640 (python)

Fixed submission:
#!/usr/local/bin/python3
# coding: utf-8

ha = input()
kita = ha.split(" ")
x = int(kita[0])
y = int(kita[1])
ifAshi = False

if(x == 1):
    if(y == 2 or y == 4):
        ifAshi = True
if(x*2 == y):
    ifAshi = True
for i in range(x):
        
    if((y - 2*i)%4 == 0):
        if((x-i) == ((y - 2*i)/4)):
            ifAshi = True

if(ifAshi):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#!/usr/local/bin/python3
# coding: utf-8

ha = input()
kita = ha.split(" ")
x = int(kita[0])
y = int(kita[1])
ifAshi = False

for i in range(x):
    if(x = 1):
        if(y == 2 or y == 4):
            ifAshi = True
    if((y - 2*i)%4 == 0):
        if((x-i) == ((y - 2*i)/4)):
            ifAshi = True

if(ifAshi):
    print("Yes")
else:
    print("No")
Problem p02657 (python)

Fixed submission:
#!/usr/local/bin/python3
# coding: utf-8
hairu = input()
kita = hairu.split(" ")
a = int(kita[0])
b = int(kita[1])

print(a*b)

Buggy submission (verdict: Runtime Error):
#!/usr/local/bin/python3
# coding: utf-8
n = input()
hairu = input()
kita = hairu.split(" ")
seki = 1

try:
    for c in kita:
        if seki > 10**18:
            print("-1")
            break
        else:
            seki = seki * int(c)
            if seki > 10**18:
                print("-1")
            else:
                print(seki)
except:
    print("-1")
Problem p02658 (python)

Fixed submission:
#!/usr/local/bin/python3
# coding: utf-8
n = input()
hairu = input()
kita = hairu.split(" ")
seki = 1

for c in kita:
    if c == "0":
        kita[0] = "0"

for c in kita:
    seki = seki * int(c)
    if seki > 10**18:
        break

if seki > 10**18:
    print("-1")
else:
    print(seki)

Buggy submission (verdict: Runtime Error):
#!/usr/local/bin/python3
# coding: utf-8
n = input()
hairu = input()
kita = hairu.split(" ")
a = []
int seki = 1
for c in kita:
    a.append(c)
try:
    for c in a:
        c = c * int(c)
    if c > 10**18:
        print("-1")
    else:
        print(c)
except:
    print("-1")