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

Fixed submission:
a, b, c = map(int, input().split())
if a<c & c<b:
  print('Yes')
elif b<c & c<a:
    print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a<b && b<c:
  print('Yes')
  elif c<b && b<a:
    print('Yes')
else:
  print('No')
Problem p03076 (python)

Fixed submission:
l = list(int(input()) for i in range(5))
nlist = []
Sum = 0

for i in range(5):
    if l[i]%10 == 0:
        nlist.append(0)
    else:
        nlist.append(10 - (l[i]%10))
        
if nlist[0] == nlist[1] == nlist[2] == nlist[3] == nlist[4] == 0:
    print(l[0]+l[1]+l[2]+l[3]+l[4])
else:
    #リストlにリストnlistをそれぞれ加える
    for i in range(5):
        Sum += l[i] + nlist[i]
    print(Sum - max(nlist))

Buggy submission (verdict: Runtime Error):
a, b, c, d, e = [int(input()) for i in range(5)]
list = [a, b, c, d, e]
nlist = [a%10, b%10, c%10, d%10, e%10]
nlist.remove('0')

#mod10で並べた数字のうち最小のものを削除
nlist.sort() 
nlist.remove(0)
mlist = map(10 - nlist)
Sum = sum(list) + sum(mlist)
print (Sum)
Problem p03087 (python)

Fixed submission:
n, q = map(int, input().split())
S = input()
 
counts = [0 for i in range(n)]
cnt = 0
 
for i in range(n):
  if S[i-1:i+1] == "AC":
    cnt += 1
  counts[i] = cnt
    
for i in range(q):
    l, r = map(int, input().split())
    print(counts[r-1] - counts[l-1])

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
S = input()
 
counts = [0 for i in range(n)]
cnt = 0
 
for i in range(n):
  if (S[i-1:i+1] == "AC":)
    cnt += 1
    counts[i] = cnt
    
for i in range(q):
    l, r = map(int, input().split())
    print(counts[r-1] - counts[l-1])

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

counts = [0 for i in range(N)]
cnt = 0

for i in range(n):
  if S[i-1:i+1] == "AC":
    cnt += 1
    counts[i] = cnt
    
for i in range(q):
  l, r = map(int, input().split())
  print (counts[r-1] - counts[l-1])

Buggy submission (verdict: Runtime Error):
S = input()
import re
def appear(i, j)
 T = S[i:j+1]
 T.count('AC')
Problem p03103 (python)

Fixed submission:
N, M = map(int, input().split())
shops = sorted([list(map(int, input().split())) for i in range(N)])
drink = 0
cost = 0

for i in range(N):
    cost += shops[i][0]*shops[i][1]
    drink += shops[i][1]
    if drink >= M:
        cost -= (drink -M) * shops[i][0]
        break
        
print(cost)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
shops = sorted([list(map(int, input().split())) for i in range(n)])
drink = 0
cost = 0

for i in range(N):
    cost += shops[i][0]*shops[i][1]
    drink += shops[i][1]
    if drink >= M:
        cost -= (drink -　M) * shops[i][0]
        break
        
print(cost)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
shops = sorted([list(map(int, input().split())) for i in range(n)])
drink = 0
cost = 0

for i in range(N):
    cost += shops[i][0]*shops[i][1]
    drink += shops[i][1]
    if drink >= m:
        cost -= (drink -m) * shops[i][0]
        break
        
print(cost)
Problem p04044 (python)

Fixed submission:
N, L = map(int, input().split())
 
#標準入力からリストの作成
list = []
for _ in range(N):
 i = str(input())
 list.append(i)

#リストのソート
list_a = sorted(list)
 
#リストの結合
mojiretu = ''.join(list_a)
 
print(mojiretu)

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
 
#標準入力からリストの作成
list = []
for _ in range(N):
 i = input()
list.append(i)

#リストのソート
list_a = list.sorted()
 
#リストの結合
mojiretu = ''.join(list_a)
 
print(mojiretu)

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
 
#標準入力からリストの作成
list = []
for _ in (1,N):
 i = input()
 list.append(i)
 
#リストの結合
mojiretu = ''.join(list)
 
print(mojiretu

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
 
#標準入力からリストの作成
list = []
for _ in range(1,N):
 i = input()
 list.append(i)
 
#リストの結合
mojiretu = ''.join(list)
 
print(mojiretu

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
 
#標準入力からリストの作成
a = map(str, input().split())
a = a.sort()
 
#リストの結合
mojiretu = ''.join(a)
 
print(mojiretu)

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())

#標準入力からリストの作成
a = map(str, input().split())
a = a.sort()

#リストの結合
mojiretu = ''join(a)

print(mojiretu)
Problem p02576 (python)

Fixed submission:
import math
N, X, T = map(float, input().split())

ans = N / X

ans = math.ceil(ans)

time = ans * T

print(int(time))

Buggy submission (verdict: Runtime Error):
N =int(input())
lst = []

N = str(N)

list_num = list(N)

N = [int(s) for s in list_num]
ans = sum(N)

if ans % 9 == 0:
  print("Yes")
else:
  print("No")
Problem p02613 (python)

Fixed submission:
n = int(input())
a=0
w=0
t=0
r=0

for i in range(n):
    ans = input()

    if ans == 'AC':
        a+=1
    elif ans == 'WA':
        w+=1
    elif ans == 'TLE':
        t+=1
    else:
        r+=1

print("AC x"+" "+str(a))
print("WA x"+" "+str(w))
print("TLE x"+" "+str(t))
print("RE x"+" "+str(r))

Buggy submission (verdict: Runtime Error):
n = int(input())
a=0
w=0
t=0
r=0

for i in range(n):
    ans = input()

    if ans == 'AC':
        a+=1
    elif ans == 'WA':
        w+=1
    elif ams == 'TLE':
        t+=1
    else:
        r+=1

print("AC x" +str(a))
print("WA x" +str(w))
print("TLE x" +str(t))
print("RE x" +str(r))
Problem p03064 (python)

Fixed submission:
M=998244353
N=int(input())
d=[0]*90001
d[0]=1
e=[0]*90001
e[0]=1
z=1
s=0
for _ in range(N):
	a=int(input())
	i=s
	while i>=0:
		d[i+a]+=d[i]%M
		d[i]*=2
		e[i+a]+=e[i]%M
		i-=1
	s+=a
	z=z*3%M
for i in range(s+1>>1,s+1):
	z-=d[i]*3
	z%=M
print([(z+e[s//2]*3)%M,z][s%2])

Buggy submission (verdict: Runtime Error):
M=998244353
N,*A=map(int,open(0))
d=[0]*90001
d[0]=1
e=d.copy()
z=1
s=0
for a in A:
	i=s;s+=a;z=z*3%M
	while i>=0:d[i+a]+=d[i]%M;d[i]*=2;e[i+a]+=e[i]%M;i-=1
for i in range(s+1>>1,s+1):z=(z-d[i]*3)%M
print([(z+e[s//2]*3)%M,z][s%2])
Problem p04011 (python)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
sum = 0
if n>=k:
  sum = k*x + (n - k)*y
  print(sum)
	
else:
  sum = n*x
  print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
x = int(input())
y = int(input())
sum = 0
if (n >= k):
	sum = k*x + (n - k)*y
    print(sum)
else:
	sum = n*x
    print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
x = int(input())
y = int(input())
sum = 0
if n >= k:
	sum = k*x + (n - k)*y
    print(sum)
else:
	sum = n*x
    print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
x = int(input())
y = int(input())
sum = 0
if (n >= k):
	sum = k*x + (n - k)*y
    print(sum)
else:
	sum = n*x
    print(sum)
Problem p02534 (python)

Fixed submission:
# cook your dish here
n=int(input())
s="ACL"*n

print(s)

Buggy submission (verdict: Runtime Error):
# cook your dish here
n=int(input())
s=""
for i in range(k):
    s+="ACL"
print(s)
Problem p02553 (python)

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

l = [a*d,a*c,b*c,b*d]
print(max(l))

Buggy submission (verdict: Runtime Error):
a,b,c,d = list(map(int, input().split()))

if a > 0 and b > 0 and c > 0 and d > 0:
  ans = b * d
elif a < 0 and c > 0 and d > 0:
  ans = b * d
elif a < 0 and b < 0 and c > 0 and d > 0:
  ans = b * c
elif a > 0 and b > 0 and c < 0 and d < 0:
  ans = a * d
elif a > 0 and b > 0 and c < 0 and d > 0:
  ans = b * d
elif a < 0 and c < 0:
  ans = a * c

print(ans)
Problem p02646 (python)

Fixed submission:
A,V = map(int, input().split())
B,W = map(int, input().split())
T = int(input())

if abs(A-B) <= V*T-W*T:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
A,V = map(int, input().split())
B,W = map(int, input().split())
T = int(input())

if abs(A-B) =< V*T-W*T:
  print('YES')
else:
  print('NO')
Problem p02717 (python)

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

X, Y = Y, X
X, Z = Z, X

print(X, Y, Z)

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

a = sorted(A, reverse=True)

b = a[M-1]
c = sum(a)
d = 4*M
e = c//d

if a[M-1]>e:
  print('Yes')
else:
  print('No')
Problem p02730 (python)

Fixed submission:
S = str(input())
N = int(len(S))

x = int((N-1)/2)
y = int((N+3)/2)

a = str(S[:x])
b = str(S[y:N-1])

reverse_S = ''.join(list(reversed(S)))
reverse_a = ''.join(list(reversed(a)))
reverse_b = ''.join(list(reversed(b)))

if str(S) == str(reverse_S) and str(a) == str(reverse_a) and str(b) == str(reverse_b):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = input()
N = len(S)

x = (N-1)/2
y = (N+3)/2

a = S[:x]
b = S[:y]

if a == reversed(a) and b == reversed(b):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = input()
N = int(len(S))

x = (N-1)/2
y = (N+3)/2

if S[:x] == S[:x].reverse() and S[:y] == S[:y].reverse():
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = input()
N = len(S)

x = (N-1)/2
y = (N+3)/2


if S[:x] == S[:x].reverse() and S[:y] == S[:y].reverse():
  print('Yes')
else:
  print('No')
Problem p02741 (python)

Fixed submission:
K = int(input())
k = K-1
numbers = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]


print(numbers[k])

Buggy submission (verdict: Runtime Error):
numbers = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())

print(numbers[K])
Problem p03059 (python)

Fixed submission:
A,B,T = map(int,input().split())
count = int((T+0.5)/A)
ans = B*count
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,T = map(int,input().split)
count = int((T+0.5)/A)
ans = B*count
print(ans)
Problem p03434 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)

Alice = sum(a[::2])
Bob = sum(a[1::2])

print(Alice - Bob)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)

Alice = Sum(a[::2])
Bob = Sum(a[1::2])

print(Alice - Bob)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)

Alice = a[0::2]
Bob = a[1::2]

print(Alice - Bob)
Problem p03455 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
if a*b%2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a*b%2 == 0{
  print("Even")
}else{
  print("Odd")
}
Problem p03493 (python)

Fixed submission:
number = input()
sum = 0

for i in range(3):
  if number[i] == '1':
    sum += 1
print(sum)

Buggy submission (verdict: Runtime Error):
numbers = input()
number = list(number)
sum = 0
if number[0] == 1:
  sum = sum + 1
if number[1] == 1:
  sum = sum + 1
if number[2] == 1:
  sum = sum + 1
print(sum)
Problem p02911 (python)

Fixed submission:
N,K,Q = map(int,input().split(' '))
A_i = list()
for k in range(Q):
    k = int(input())
    A_i.append(k)

First = [K-Q] * N

for i in A_i:
    First[i-1] += 1
for j in First:
    if j <= 0:
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
N,K,Q = map(int,input().split(' '))
A_i = list()
for k in range(Q):
    k = int(input())
    A_i.append(k)

First = [K-Q] * N

for i in A_i:
    First[i] += 1
for j in First:
    if j <= 0:
        print('No')
    else:
        print('Yes')
Problem p03427 (python)

Fixed submission:
N = input()
l = list(map(int,N))
i = 0
#ans = l[0] - 1 + (len(l)-1)*9 #暫定の答え

if int(N) < 9:
    ans  = int(N)

elif l.count(9) >= len(l)-1:
    if l[len(l)-1] != 9:
        spot = 8
    else:
        spot = min(l)
    ans = spot + (len(l)-1)*9

else:
    while True:
        if l[i] < 9 and i < len(l)-1:
            spot = l[i] - 1
            break
        else:
            i += 1 
    ans = spot + (len(l)-1)*9

print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
l = list(map(int,N))
i = 0
#ans = l[0] - 1 + (len(l)-1)*9 #暫定の答え

if int(N) < 9:
    ans  = 0
elif l.count(9) >= len(l)-1:
    if l[len(l)-1] != 9:
        spot = 8
    else:
        spot = min(l)

else:
    while True:
        if l[i] < 9 and i < len(l)-1:
            spot = l[i] - 1
            break
        else:
            i += 1 
ans = spot + (len(l)-1)*9
print(ans)
Problem p02536 (python)

Fixed submission:
class Unionfind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * (n)
        
    def find(self, x):
        if(self.parents[x] < 0):
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
        
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if(x == y):
            return
        
        if(self.parents[x] > self.parents[y]):
            x, y = y, x
            
        self.parents[x] += self.parents[y]
        self.parents[y] = x
    
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
    
    def group_count(self):
        return len(self.roots())

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


for _ in range(m):
    a, b = map(int, input().split())
    uf.union(a-1, b-1)

print(uf.group_count()-1)

Buggy submission (verdict: Runtime Error):
class Unionfind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * (n)
        
    def find(self, x):
        if(self.parents[x] < 0):
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
        
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if(x == y):
            return
        
        if(self.parents[x] > self.parents[y]):
            x, y = y, x
            
        self.parents[x] += self.parents[y]
        self.parents[y] = x
    
    def size(self, x):
        return -self.parents[self.find(x)]
    
    def same(self, x, y):
        return self.find(x) == self.find(y)
    
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
    
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
    
    def group_count(self):
        return len(self.roots())
    
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
    
    def __str__(self):
        return '\n'.join('{}:{}'.format(r, self.members(r)) for r in self.roots())

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


for _ in range(m):
    a, b = map(int, input().split())
    uf.union(a, b)

print(uf.group_count()-1)
Problem p02554 (python)

Fixed submission:
n = int(input())
mod = (10**9)+7
ans = (10**n) - 2*(9**n) + 8**n
print(ans%mod)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
hoge = 10**9+7
if N == 1:
    print(0)
else:
    a = math.factorial(N) / math.factorial(N-2)
    b = 10**(N-2)
    print(a*b%hoge)
Problem p02582 (python)

Fixed submission:
s=input()
num=0
a=[0]
for i in s:
    if i=="R":
        num+=1
        a.append(num)
    else:
        num=0
print(max(a))

Buggy submission (verdict: Runtime Error):
s=input()
num=0
a=[]
for i in s:
    if i=="R":
        num+=1
    elif i!="R":
        a.append(num)
        num=0
print(max(a))
Problem p02730 (python)

Fixed submission:
s=str(input())
n=len(s)//2
f=s[:n]
if f==f[::-1] and f==s[n+1:]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s=str(input())
n=int(len(s))
a=int(((n-1)/2)+1)
b=int(((n+3)/2)+1)
if s[0]==s[a] and s[b]==s[n-1]:
    print("Yes")
else:
    print("No")
Problem p03292 (python)

Fixed submission:
A=list(map(int,input().split()))
A=sorted(A)
print(abs(A[2]-A[0]))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
print("Yay!" if A<=8 and B<=8 else ":(")
Problem p03378 (python)

Fixed submission:
n,m,x=map(int,input().split())
a=list(map(int,input().split()))
b=[0]*(n+1)
for i in a:
    b[i]=1
print(min(sum(b[:x]),sum(b[x:])))

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for i in range(m):
    if a[m]<x:
        ans+=1
 
print(min(ans,m-ans))
Problem p02700 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
flag = 100
while flag ==100:
    C -= B
    if flag==100 and C<=0:
        flag = 0
    A -= D
    if flag==100 and A<=0:
        flag = 1
if flag==0: print('Yes')
else: print('No')

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
flag == 100
while flag ==100:
    C -= B
    if flag==100 and C<=0:
        flag = 0
    A -= D
    if flag==100 and A<=0:
        flag = 1
if flag==0: print('Yes')
else: print('No')
Problem p02713 (python)

Fixed submission:
from functools import reduce
import math

N = int(input())
sum = 0
def gcd(*numbers):
    return reduce(math.gcd, numbers)

for i in range(1,N+1):
    for j in range(1, N+1):
        for k in range(1, N+1):
            sum += gcd(i,j,k)
print(sum)

Buggy submission (verdict: Runtime Error):
from functools import reduce
import math

N = int(input())
sum = 0
def gcd(*numbers):
    return reduce(math.gcd, numbers)

for i in range(1,N+1):
    for j in range(1, N+1):
        for k in range(1, N+1):
            sum += gcd(i,j,k)
            b.sort()
            a.append(b)
print(sum)
Problem p02718 (python)

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
sum_ = 0
for i in a:
    sum_ +=i
if(a[m-1]>=sum_/(4*m)):
    print('Yes')
else: print('No')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split())).sort()
sum_ = 0
for i in a:
    sum_ +=i
if(a[m-1]>(sum_/4*m)):
    print('Yes')
else: print('No')
Problem p02730 (python)

Fixed submission:
def pal(string):
    return True if string==string[::-1] else False

S = input()

if pal(S) and pal(S[0:int((len(S)-1)/2)]) and pal(S[int((len(S)+3)/2)-1:]):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
def pal(string):
    return True if string==string[::-1] else False

S = input()

if palindrome(S) and palindrome(S[0:int((len(S)-1)/2)]) and palindrome(S[int((len(S)+3)/2)-1:]):
    print('Yes')
else:
    print('No')
Problem p02743 (python)

Fixed submission:
from decimal import *

a, b, c = map(int, input().split())

A = Decimal(str(a)).sqrt()+Decimal(str(b)).sqrt()-Decimal(str(c)).sqrt()
if A < 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import numpy as np
a, b, c = map(int, input().split())

A = a+b-c+2*np.sqrt(np.around(a*b, 10))
if A < 0:
    print('Yes')
else:
    print('No')
Problem p02760 (python)

Fixed submission:
A = list(map(str, input().split()))
A += list(map(str, input().split()))
A += list(map(str, input().split()))
a = []
N = int(input())
for i in range(N):
    a.append(input())
flag = 0
for i  in a:
    if i in A:
        A[A.index(i)] = "0"
B = []
C = []
D = []
E = []
F = []
for i in range(3):
    B.append(A[4*i])
    C.append(A[2*(i+1)])
    D.append(A[3*i])
    E.append(A[3*i+1])
    F.append(A[3*i+2])
    if "0" in A[i*3:i*3+3]:
        if A[i*3:i*3+3].count("0") == 3:
            flag = 1
if "0" in B:
    if B.count("0") == 3:
        flag = 1
if"0"in C:
    if C.count("0") == 3:
        flag = 1
if"0"in D:
    if D.count("0") == 3:
        flag = 1
if"0"in E:
    if E.count("0") == 3:
        flag = 1
if"0"in F:
    if F.count("0") == 3:
        flag = 1
if flag == 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
flag = 0
for i  in a:
    if i in A:
        A[A.index(i)] = "0"
B = []
C = []
D = []
E = []
F = []
for i in range(3):
    B.append(A[4*i])
    C.append(A[2*(i+1)])
    D.append(A[3*i])
    E.append(A[3*i+1])
    F.append(A[3*i+2])
    if "0" in A[i*3:i*3+3]:
        if A[i*3:i*3+3].count("0") == 3:
            flag = 1
if "0" in B:
    if B.count("0") == 3:
        flag = 1
if"0"in C:
    if C.count("0") == 3:
        flag = 1
if"0"in D:
    if D.count("0") == 3:
        flag = 1
if"0"in E:
    if E.count("0") == 3:
        flag = 1
if"0"in F:
    if F.count("0") == 3:
        flag = 1
if flag == 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A = list(map(str, input().split()))
A += list(map(str, input().split()))
A += list(map(str, input().split()))
a = []
N = int(input())
for i in range(7):
    a.append(input())
flag = 0
for i  in a:
    if i in A:
        A[A.index(i)] = "0"
B = []
C = []
for i in range(3):
    B.append(A[4*i])
    C.append(A[2*i])
    if "0" in A[i*3:i*3+3]:
        if A.count("0") == 3:
            flag = 1
if "0" in B:
    if B.count("0") == 3:
        flag = 1
if"0"in C:
    if C.count("0") == 3:
        flag = 1
if flag == 1:
    print("Yes")
else:
    print("No")
Problem p04045 (python)

Fixed submission:
N, K = map(int, input().split())
D = list(map(str, input().split()))
for i in range(N, 100000):
    s = list(str(i))
    flg = 0
    for j in s:
        if j in D:
            flg = 1
            break
    if flg == 0:
        print("".join(s))
        break

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
D = list(map(str, input().split()))
for i in range(n, 100000):
    s = list(str(i))
    flg = 0
    for j in s:
        if j in d:
            flg = 1
            break
    if flg == 0:
        print("".join(s))
        break
Problem p03128 (python)

Fixed submission:
N,M = map(int,input().split())
A = list(map(int,input().split()))
num = [0,2,5,5,4,5,6,3,7,6]

dp = [0]*(N+1)

for i in range(N+1):
	for j in range(len(A)):
		if i-num[A[j]]<0:
			continue
		if i-num[A[j]]>0 and dp[i-num[A[j]]]==0:
			continue
		dp[i] = max(dp[i],dp[i-num[A[j]]]+1)

A.sort()
A.reverse()
ans = ""
now = N
while now!=0:
	for i in range(len(A)):
		if now-num[A[i]]<0:
			continue
		if dp[now-num[A[i]]]==dp[now]-1:
			if dp[now-num[A[i]]]==0 and now-num[A[i]]!=0:
				continue
			ans = ans+str(A[i])
			now -= num[A[i]]
			break
print(ans)

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
using namespace std;

int N,M;
int A[10],num[10] = {0,2,5,5,4,5,6,3,7,6};
vector<int> B;
vector<string> v;

void dfs(int n,string S){
	if(n==0) v.push_back(S);
	else{
		for(int i=0;i<(int) B.size();i++){
			char c = '0'+B[i];
			if(n-num[B[i]]>=0) dfs(n-num[B[i]],S+c);
		}
	}
}

int main(){
	cin >> N >> M;
	int cnt = 100;
	int a;
	for(int i=1;i<=M;i++){
		cin >> A[i];
		if(cnt>=num[A[i]]){
			cnt = num[A[i]];
			a = A[i];
		}
	}
	set<int> s;
	sort(A+1,A+M+1,greater<int>());
	for(int i=1;i<=M;i++){
		if(s.count(num[A[i]])==0){
			B.push_back(A[i]);
			s.insert(num[A[i]]);
		}
	}
	string ans;
	while(N-cnt>=0){
		char c = '0'+a;
		ans = ans+c;
		N -= cnt;
	}
	for(int i=0;i<(int) B.size();i++){
		if(N-num[B[i]]==0){
			char c = '0'+B[i];
			if(B[i]>a) ans = c+ans;
			else ans = ans + c;
			cout << ans << endl;
			return 0;
		}
	}
	string now = ans;
	int l = ans.size();
	ans = "";
	int c = 0;
	while(c<=min(l-1,7)){
		now.erase(now.begin()+(int) now.size()-1);
		c++;
		N += cnt;
		dfs(N,"");
		for(int i=0;i<(int) v.size();i++){
			string s1 = now+v[i],s2 = v[i]+now;
			if(ans.size()>s1.size()) continue;
			if(s1>s2 && s1>ans) ans = s1;
			else if(s2>s1 && s2>ans) ans = s2;
		}
		v.clear();
	}
	cout << ans << endl;
}
Problem p02945 (python)

Fixed submission:
a,b=map(int,input().split())
print(max([a-b,a+b,a*b]))

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
print(max([a-b,a+b,a*b]))