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

Fixed submission:
# -*- coding: utf-8 -*-
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

ans = 0
tmp = [A, B, C, D, E]
Y = []
Z = []
for i in range(5):
    Y.append([tmp[i] % 10, tmp[i]])
Y.sort()
#print(Y)
for i in range(5):
    if Y[i][0] != 0:
        Z.append(i)
if len(Z) != 0:
    for i in range(5):
        X = Y[i][1]
        #print(i)
        while X % 10 != 0:
            X += 1
        ans += X
        #print(X)
        #print(ans)
    G = Y[Z[0]][1]
    while G % 10 != 0:
        G += 1
    ans -= G
    ans += Y[Z[0]][1]
    #print(tmp[0])
else:
    ans = sum(tmp)
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

ans = 0
tmp = [A, B, C, D, E]
Y = []
Z = []
for i in range(5):
    Y.append([tmp[i] % 10, tmp[i]])
Y.sort()
#print(Y)
for i in range(5):
    if Y[i][0] != 0:
        Z.append(i)
for i in range(5):
    X = Y[i][1]
    #print(i)
    while X % 10 != 0:
        X += 1
    ans += X
    #print(X)
    #print(ans)
G = Y[Z[0]][1]
while G % 10 != 0:
    G += 1
ans -= G
ans += Y[Z[0]][1]
#print(tmp[0])
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

ans = 0
tmp = [A, B, C, D, E]
Y = []
Z = []
L = []
for i in range(5):
    Y.append([tmp[i] % 10, tmp[i]])
Y.sort()
#print(Y)
for i in range(5):
    if Y[i][0] != 0:
        Z.append(i)
    else:
        L.append(i)
for i in range(5):
    X = Y[i][1]
    #print(i)
    while X % 10 != 0:
        X += 1
    ans += X
    #print(X)
    #print(ans)
G = Y[Z[0]][1]
while G % 10 != 0:
    G += 1
ans -= G
ans += Y[Z[0]][1]
#print(tmp[0])
print(ans)
Problem p03146 (python)

Fixed submission:
# -*- coding: utf-8 -*-
s = int(input())

a = [s]
for i in range(1000001):
    #print(i)
    if a[i] % 2 == 0:
        a.append(a[i] // 2)
    else:
        a.append(3 * a[i] + 1)
#print(a)
i = 0
flag = True
while flag:
    for j in range(i):
        if a[i] == a[j]:
            ans = i + 1
            flag = False
            break
    i += 1
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
s = int(input())

a = [s]
for i in range(10):
    #print(i)
    if a[i] % 2 == 0:
        a.append(a[i] // 2)
    else:
        a.append(3 * a[i] + 1)
#print(a)
i = 0
flag = True
while flag:
    for j in range(i):
        if a[i] == a[j]:
            ans = i + 1
            flag = False
            break
    i += 1
print(ans)
Problem p03361 (python)

Fixed submission:
# -*- coding: utf-8 -*-
h, w = map(int,input().split())
s = []
for i in range(h):
    s.append(list(input()))

ans = "Yes"
for i in range(h):
    for j in range(w):
        if s[i][j] == '#' and s[max(0,i - 1)][j] == '.' and s[min(h - 1, i + 1)][j] == '.' and s[i][min(w - 1, j + 1)] == '.' and s[i][max(0, j - 1)] == '.':
            ans = "No"
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
h, w = map(int,input().split())
s = []
for i in range(w):
    s.append(list(input()))

ans = "Yes"
for i in range(h):
    for j in range(w):
        if s[i][j] == '#' and s[max(0,i - 1)][j] == '.' and s[min(h - 1, i + 1)][j] == '.' and s[i][min(w - 1, j + 1)] == '.' and s[i][max(0, j - 1)] == '.':
            ans = "No"
print(ans)
Problem p03456 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a,b = map(int,input().split())

"""
if b < 10:
    number = 10 * a + b
if 10 <= b < 100:
    number = 100 * a + b
if b == 100:
    number = 1000 * a + b
"""

number = 10 ** len(str(b)) * a + b

ans = "No"
"""
for i in range(4, 101):
    if i ** 2 == number:
        ans = "Yes"
"""

if number ** 0.5 == int(number ** 0.5):
    ans = "Yes"

print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a,b = map(int,input().split())

"""
if b < 10:
    number = 10 * a + b
if 10 <= b < 100:
    number = 100 * a + b
if b == 100:
    number = 1000 * a + b
"""

number = 10 ** len(b) * a + b

ans = "No"
for i in range(101):
    if i * i == number:
        ans = "Yes"

print(ans)
Problem p03711 (python)

Fixed submission:
# -*- coding: utf-8 -*-S
x,y = [int(i) for i in input().split()]

"""
if x == 2 or y == 2:
    print("No")
elif x == 4 or x == 6 or x == 9 and y == 6 or y == 9 or y == 11:
    print("Yes")
elif x == 1 or x == 3 or x == 5 or x == 7 or x == 8 or x == 10　and y == 3 or y == 5 or y == 7 or y == 8 or y == 10 or y == 12:
    print("Yes")
else:
    print("No")
"""

A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
tmp = False

for i in range(7):
    if A[i] == x:
        for j in range(i,7):
            if A[j] == y:
                tmp = True
for i in range(4):
    if B[i] == x:
        for j in range(i,4):
            if B[j] == y:
                tmp = True
if tmp:
    print("Yes")
if not tmp:
    print("No")

Buggy submission (verdict: Runtime Error):
x,y = [int(i) for i in input().split()]
if x == 2 or y == 2:
    print("No")
elif (x == 4 or x == 6 or x == 9) and (y == 6 or y == 9 or y == 11):
    print("Yes")
elif (x == 1 or x == 3 or x == 5 or x == 7 or x == 8 or x == 10)　and (y == 3 or y == 5 or y == 7 or y == 8 or y == 10 or y == 12):
    print("Yes")
else:
    print("No")
Problem p03760 (python)

Fixed submission:
# -*- coding: utf-8 -*-
o = list(input())
e = list(input())

len_o = len(o)
len_e = len(e)

if len_o == len_e:
    for i in range(len_o - 1):
        print(o[i], end = '')
        print(e[i], end = '')
    print(o[len_o - 1], end = '')
    print(e[len_e - 1])

else:
    for i in range(min(len_o, len_e)):
        print(o[i], end = '')
        print(e[i], end = '')
    if len_e > len_o:
        print(e[len(e) - 1])
    if len_o > len_e:
        print(o[len(o) - 1])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
o = list(input())
e = list(input())

len_o = len(o)
len_e = len(e)

if len_o == len_e:
    for i in range(len_o - 1):
        print(o[i], end = '')
        print(e[i], end = '')
    print(o[len_o - 1], end = '')
    print(e[len_e - 1])

else:
    for i in range(min(len_o, len_e):
        print(o[i], end = '')
        print(e[i], end = '')
    if len_e > len_o:
        print(e[len(e) - 1])
    if len_o > len_e:
        print(o[len(o) - 1])
Problem p03796 (python)

Fixed submission:
n = int(input())

ans = 1
#34ms
for i in range(1, n + 1):
    ans = (ans * i) % (10 ** 9 + 7)
print(ans)

Buggy submission (verdict: Runtime Error):
#include <stdio.h>
#include <math.h>
int main(void){
    long int n;
    scanf("%ld", &n);

    long int ans = 1;
    long int tmp = pow(10, 9);
    for (long int i = 1; i <= n; i++){
        ans = ans * i;
    }
    printf("%ld\n", ans % (tmp + 7));

    return 0;
}
Problem p02657 (python)

Fixed submission:
def main():
  a,b = list(map(int,input().split()))
  print(a*b)
main()

Buggy submission (verdict: Runtime Error):
def main():
  a,b = list(map(int,input().split()))
    print(a*b)
main()
Problem p03352 (python)

Fixed submission:
import math
def main():
  x = int(input())
  sum=0
  if x==0 or x==1:
    sum=x
  else:
    for i in range(2,int(math.sqrt(x))+1):
      j=2
      while True:
        if pow(i,j) <= x:
          if pow(i,j) > sum:
            sum=pow(i,j)
        else:
          break
        j+=1
  print(sum)
main()

Buggy submission (verdict: Runtime Error):
import math
def main():
  x = int(input())
  sum=0
  if x==0 or x==1:
    sum=x
  else:
    for i in range(2,int(math.sqrt(x))+1):
      j=2
      while True:
         if pow(i,j)<=x:
          if pow(i,j)>sum:
            sum=pow(i,j)
        else:
          break
        j+=1
  print(sum)
main()
Problem p02639 (python)

Fixed submission:
a=list(map(int,input().split()))
count=1
for x in a:
  if x!=0:
    count+=1
  else:
    break
print(count)

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
if y%2==0 and 2*x<=y and y<=4*x:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
if y%2==0 and 2*x<=y and y<=4*x:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
if y%2==0 and 2*x<=y and y<=4*x:
    print('Yes')
else:
    print('No')
Problem p02658 (python)

Fixed submission:
# coding: utf-8

n = int(input())
numlist = list(map(int, input().split()))
ans = 1;

if 0 in numlist:
    ans = 0
else:
    for i in numlist:
        ans *= i
        if ans > 10**18:
            ans = -1
            break

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
m=list(map(int,input().split()))
x=1
if 0 in m:
  print(0)
else:
  for y in m:
    x*=y
    if x>10**18:
      print(-1)
      break
	else:
      print(x)

Buggy submission (verdict: Runtime Error):
x=1
n=int(input())
a=map(int,input().split())
m=list(a)
for x in m:
  if x==0:
    print(0)
  else:
    x*=x
if x<=10**18 and x!=0:
  print(x)
elif x==0:
  break
else:
  print(-1)
Problem p02675 (python)

Fixed submission:
N=int(input())
if N%10==3:
    print('bon')
elif N%10==0 or  N%10==1 or  N%10==6 or  N%10==8:
    print('pon')
else:
    print('hon')

Buggy submission (verdict: Runtime Error):
N=input()
if N%10==3:
    print('bon')
elif N%10==0 or  N%10==1 or  N%10==6 or  N%10==8:
    print('pon')
else:
    print('hon')

Buggy submission (verdict: Runtime Error):
N=input()
if N%10==3:
    print('bon')
elif N%10==0 or  N%10==1 or  N%10==6 or  N%10==8:
    print('pon')
else:
    print('bon')
Problem p02717 (python)

Fixed submission:
X,Y,Z=input().split()
N=[X,Y,Z]
print(N[2],N[0],N[1])

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
A=list(map(int,input().split()))
s=sorted(A,reverse=True)[m-1]
t=sum(A)//(4*m)+1
if s>=t:
    ans='Yes'
else:
    ans='No'
print(ans)
Problem p02783 (python)

Fixed submission:
h,a=map(int,input().split())
if h%a!=0:
  n=int(h/a)+1
  print(n)
else:
  n=int(h/a)
  print(n)

Buggy submission (verdict: Runtime Error):
h,a=map(int,input().split())
if h%a!=0:
  n=int(h/a)+1
  print(n)
else:
  n-=1
  print(n)
Problem p03166 (python)

Fixed submission:
import sys

sys.setrecursionlimit(10**9)

n , m = map(int,input().split())

g = [[] for i in range(n)]

dp = [-1] *n
for _ in range(m):
  v1 , v2 = map(int,input().split())
  v1 -=1; v2 -=1
  g[v1].append(v2)
  
# finding longest path for vertice i
def dfs(i):
  if dp[i]!=-1:
    return dp[i]
  temp = 0
  for nv in g[i]:
    temp = max(temp, dfs(nv)+1)
  
  dp[i]=temp
  return temp
  
# finding overall longest path  
res = 0  
for i in range(n):
  res = max(res, dfs(i))
  
print(res)

Buggy submission (verdict: Runtime Error):
n , m = map(int,input().split())
 
g = [[] for i in range(n)]
 
dp = [-1] *n
for _ in range(m):
  v1 , v2 = map(int,input().split())
  v1 -=1; v2 -=1
  g[v1].append(v2)
def dfs(i):
  if dp[i]!=-1:
    return dp[i]
  temp = 0
  for nv in g[i]:
    temp = max(temp, dfs(nv)+1)
  dp[i]=temp
  return temp
res = 0  
for i in range(n):
  res = max(res, dfs(i))
  
print(res)
Problem p02640 (python)

Fixed submission:
x, y = map(int, input().split())
if y >= 2*x and y <= 4*x and y % 2 == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
if y >= 2*x and y <= 4*x and y % 2 == 0 
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
if x >= 2*x and y <= 4*y and y % 2 ==0 or y % 4 ==0:
  print(Yes)
else:
  print(No)
Problem p02681 (python)

Fixed submission:

    
s = input()
t = input()

if t[:-1] == s:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
 
if S == T[:-1]
     print("YES")
  else:
  print("NO")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
 
if S == T[:-1]:
  print("YES")
  else
  print("NO")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

if S == T[:-1]
     print("YES")
  else
  print("NO")

Buggy submission (verdict: Runtime Error):
import random 
S = input()
T = input()
a = ["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"]
  print(if T == S + random.coice(a) "YES"  else: print("NO"))

Buggy submission (verdict: Runtime Error):
import random 
S = input()
T = input()
a = ["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"]
if T == S + random.coice(a) 
  print(if T == S + random.coice(a) "YES"  else: print("NO"))

Buggy submission (verdict: Runtime Error):
import random 
S = input()
T = input()
a = ["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"]
if T == S + random.coice(a) 
  print("YES")
  else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import random 
S = input()
T = input()
a = [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]
if T == S + random.coice(a) 
  print("YES")
  else:
    print("NO")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
a = [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]
if T == S + a.index(input()):  
  print("YES")
  else:
    print("NO")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
a = [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]
  print(if T == S + a.index(input()): "YES")
  else:
    print("NO")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
a = [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]
  print(if T == S + .index(a)"YES")
  else:
    print("NO")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
a = [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]
if T == S + .index(a):
  print("YES")
  else:
    print("NO")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
if T == S + 1:
  print("YES")
  else:
    print("NO")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
a = input()
if T == S + a:
  print("YES")
  else:
    print("NO")
Problem p02717 (python)

Fixed submission:
X, Y, Z = map(int, input().split())
print(Z, X, Y)

Buggy submission (verdict: Runtime Error):
X, Y, Z = [int(input()) for a in range(3)]
print(Z, X, Y)

Buggy submission (verdict: Runtime Error):
X, Y, Z = [int(a) for b in input() .split()]
print(Z, X, Y)

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
Z = int(input())
print(Z, X, Y)

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
Z = int(input())

print(Z, X, Y)

Buggy submission (verdict: Runtime Error):
X, Y, Z = input()
print(Z, X, Y)

Buggy submission (verdict: Runtime Error):
X,Y,Z = input()
print(Z,X,Y)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
print(c,a,b)

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
Z = int(input())

print(Z,X,Y)
Problem p02658 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
		break
	else:
		if ans > 0:
			ans *= A[i]
		if ans > 10 ** 18:
			ans = -1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
		break
	else:
		if ans > 0
        	ans *= A[i]
		if ans > 10 ** 18:
			ans = -1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
        break
	else:
		ans *= A[i]

if ans > 10 ** 18:
	print(-1)
else:
	print(ans)
Problem p02606 (python)

Fixed submission:
L,R,D=map(int,input().split())
startno = L
while startno % D != 0:
    startno += 1 
lista=list(range(startno,R+1,D))
#print(lista)
print(len(lista))

Buggy submission (verdict: Runtime Error):
n=int(input())
import math
s=int(math.sqrt(n))
for i in range(1,n+1):
    count = 0
    for x in range(1,s):
        for y in range(1,s):
            for z in range(1,s):
                if x*x+y*y+z*z+x*y+y*z+z*x == i:
                        count += 1
    print(count)
Problem p02628 (python)

Fixed submission:
init = input().split()
N = int(init[0])
K = int(init[1])
 
prices = list(map(int, input().split()))
prices.sort()
 
sum = 0
for i, ele in enumerate(prices):
  if i >= K:
    break
  else:
  	sum = sum + ele
print(sum)

Buggy submission (verdict: Runtime Error):
init = input().split()
N = int(init[0])
K = int(init[1])
 
prices = [int(input()) for i in range(N)]
prices.sort()
 
sum = 0
for i, ele in enumerate(prices):
  if i >= K:
    break
  else
  	sum = sum + ele
print(sum)

Buggy submission (verdict: Runtime Error):
init = input().split()
N = int(init[0])
K = int(init[1])

prices = [int(input()) for i in range(N)]
prices.sort()

sum = 0
for i, ele in enumerate(prices):
  if i == K:
    break
  else
  	sum = sum + ele
print(sum)
Problem p02600 (python)

Fixed submission:
x = int(input())

if 400 <= x < 600:
    print(8)
elif 600 <= x < 800:
    print(7)
elif 800 <= x < 1000:
    print(6)
elif 1000 <= x < 1200:
    print(5)
elif 1200 <= x < 1400:
    print(4)
elif 1400 <= x < 1600:
    print(3)
elif 1600 <= x < 1800:
    print(2)
elif 1800 <= x < 2000:
    print(1)

Buggy submission (verdict: Runtime Error):
X = int(input())

if 400 <= X < 600:
    print(8)
elif 600 <= x < 800:
    print(7)
elif 800 <= x < 1000:
    print(6)
elif 1000 <= x < 1200:
    print(5)
elif 1200 <= x < 1400:
    print(4)
elif 1400 <= x < 1600:
    print(3)
elif 1600 <= x < 1800:
    print(2)
elif 1800 <= x < 2000:
    print(1)
Problem p02612 (python)

Fixed submission:
import sys 
input = sys.stdin.readline

N = int(input())

if N % 1000 == 0:
  print(0)
else:
  print(1000 - N%1000)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N = input()

print(1000 - N%1000)
Problem p02613 (python)

Fixed submission:

N = int(input())
d = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
 
for _ in range(N):
    s = input().strip()
    d[s]+=1

for k,v in d.items():
    print(k, 'x', v)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N = int(input())
d = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}

for _ in range(N):
  d[input()]+=1
  
for s in ['AC', 'WA', 'TLE', 'RE']:
  print(f'{s} X {d[s]}')
Problem p02616 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    n,k = map(int, input().split())
    A = sorted(map(int, input().split()))
    mod = 10**9 + 7
    ans, sign = 1, 1

    l, r = 0, n-1

    if k%2:
        ans = A[r]
        r-=1
        k-=1
        if ans < 0:
            sign = -1
    while k:
        x = A[l]*A[l+1]
        y = A[r]*A[r-1]

        if x*sign > y*sign:
            ans = x%mod * ans%mod
            l+=2
        else:
            ans = y%mod * ans%mod
            r-=2
        k-=2
    print((ans+mod)%mod)
main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    n,k = map(int, input().split())
    A = map(int, input().split())
    A = sorted(A, key=lambda x: abs(x), reverse=True)

    ans = 1

    minK, maxK = None, None
    for a in A[:k]:
        ans *= a
        if minK is None or a < minK:
            minK = a
        if maxK is None or a > maxK:
            maxK = a

    if ans >= 0:
        print(ans % (10**9+7))
    else:
        minK_1, maxK_1 = None, None
        for a in A[k:]:
            if minK_1 is None or a < minK_1:
                minK_1 = a
            if maxK_1 is None or a > maxK_1:
                maxK_1 = a

        tmpMax = max(ans//minK * maxK_1, ans//maxK * minK_1)
        if tmpMax > ans:
            ans = tmpMax

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

Buggy submission (verdict: Runtime Error):

def main():
    n,k=map(int,input().split())
    A = map(int,input().split())

    def prod(iterables):
        res = None
        for element in iterables:
            tmp = 1
            for e in element:
                tmp *= e
            if res is None or tmp > res:
                res = tmp
        return res
    
    pos, neg = [], []
    for a in A:
        if a >= 0:
            pos.append(a)
        else:
            neg.append(a)

    pos_n, neg_n = len(pos), len(neg)
    ans = None

    for i in range(neg_n):
        if k-i > pos_n:
            continue
        tmp = prod(permutations(neg, i)) * prod(permutations(pos, k-i)) % (10**9+7)
        if ans is None or tmp > ans:
            ans = tmp
    print(ans)
main()

Buggy submission (verdict: Runtime Error):


def main():
    n,k=map(int,input().split())
    A = map(int,input().split())

    def prod(iterables):
        res = None
        for element in iterables:
            tmp = 1
            for e in element:
                tmp *= e
            if res is None or tmp > res:
                res = tmp
        return res
    
    pos, neg = [], []
    for a in A:
        if a >= 0:
            pos.append(a)
        else:
            neg.append(a)

    pos_n, neg_n = len(pos), len(neg)
    pos, neg

    ans = None

    for i in range(neg_n):
        if k-i > pos_n:
            continue
        tmp = prod(permutations(neg, i)) * prod(permutations(pos, k-i)) % (10**9+7)
        if ans is None or tmp > ans:
            ans = tmp
    print(ans)
main()
Problem p04043 (python)

Fixed submission:
def main(input: list):
    possible575 = sorted(input) == [5, 5, 7]
    print("YES" if possible575 else "NO")


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

Buggy submission (verdict: Runtime Error):
import asyncio


async def main(input: list):
    possible575 = sorted(input) == [5, 5, 7]
    print(possible575)


input = list(map(int, input().split()))
asyncio.run(main(input))
Problem p02630 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
B=[]
for i in range(Q):
    B.append(list(map(int,input().split())))
sum=int(0)
AA=[int(0)]
for i in range(100000):
    AA.append(int(0))
for i in A:
    AA[i]+=1 #A.count(int(i))
#for i in range(5):
#    print(AA[i])
sum=int(0)
for i in range(N):
    sum += A[i]
for i in range(Q):
#    AA[(B[i][0])]=A.count(int((B[i][0])))
#    A.replace(B[i][0],B[i][1])
#    AA[(B[i][1])]=A.count(int((B[i][1])))
    sum = sum + B[i][1]*AA[(B[i][0])]-B[i][0]*AA[(B[i][0])]
    AA[(B[i][1])] = AA[(B[i][1])]+AA[(B[i][0])]
    AA[(B[i][0])] = 0
    print(sum)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
B=[]
for i in range(Q):
    B.append(list(map(int,input().split())))
sum=int(0)
AA=[int(0)]
for i in range(100000):
    AA.append(int(0))
#for i in range(100001):
#    AA[i]=A.count(int(i))
#for i in range(5):
#    print(AA[i])
sum=int(0)
for i in range(N):
    sum += A[i]
for i in range(Q):
    AA[(B[i][0])]=A.count(int((B[i][0])))
    A.replace(B[i][0],B[i][1])
#    AA[(B[i][1])]=A.count(int((B[i][1])))
    sum = sum + B[i][1]*AA[(B[i][0])]-B[i][0]*AA[(B[i][0])]
#    AA[(B[i][1])] = AA[(B[i][1])]+AA[(B[i][0])]
#    AA[(B[i][0])] = 0
    print(sum)
Problem p02658 (python)

Fixed submission:
import sys
N=int(input())
A=[]
pai=int(1)
hantei=int(0)
A=list(map(int,input().split()))
for i in range(N):
    if A[i]==0:
        print("0")
        sys.exit()
for i in range(N):
    pai=pai*A[i]
    if pai>10**18:
        print("-1")
        hantei=int(1)
        break
if hantei==0:
    print(pai)

Buggy submission (verdict: Runtime Error):
import sys
N=int(input())
A=[]
pai=int(1)
hantei=int(0)
A=list(map(int,input().split()))
for i in range(N):
    if A[i]==o:
        print("0")
        sys.exit()
for i in range(N):
    pai=pai*A[i]
    if pai>10**18:
        print("-1")
        hantei=int(1)
        break
if hantei==0:
    print(pai)
Problem p03543 (python)

Fixed submission:
n = input()
search_list = [str(x) * 3 for x in range(0,10)]
for i in search_list:
    if i in n:
        print('Yes')
        break
else:
    print("No")

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

search_list = [str(x) * 3 for x in range(1,10)]
for i in search_list:
    if i in n:
        print('Yes')
        break
else:
    print(No)