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

Fixed submission:
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)


N = int(input())
A = list(map(int, input().strip().split()))

gcd_l = [0] * N

gcd_l[0] = A[0]
for i in range(1, N):
    gcd_l[i] = gcd(gcd_l[i - 1], A[i])

gcd_r = [0] * N

gcd_r[N - 1] = A[N - 1]
for i in reversed(range(0, N - 1)):
    gcd_r[i] = gcd(gcd_r[i + 1], A[i])

gcd_lr = [0] * N

for i in range(N):
    if i == 0:
        gcd_lr[i] = gcd_r[i + 1]
    elif 1 <= i <= N - 2:
        gcd_lr[i] = gcd(gcd_l[i - 1], gcd_r[i + 1])
    elif i == N - 1:
        gcd_lr[i] = gcd_l[i - 1]

print(max(gcd_lr))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
A = list(map(int, input().strip().split()))

gcd_l = [0] * N

gcd_l[0] = A[0]
for i in range(1, N):
    gcd_l[i] = math.gcd(gcd_l[i - 1], A[i])

gcd_r = [0] * N

gcd_r[N - 1] = A[N - 1]
for i in reversed(range(0, N - 1)):
    gcd_l[i] = math.gcd(gcd_r[i + 1], A[i])

gcd_lr = [0] * N

for i in range(N):
    if i == 0:
        gcd_lr[i] = gcd_r[i + 1]
    elif 1 <= i <= N - 2:
        gcd_lr[i] = math.gcd(gcd_l[i - 1], gcd_r[i + 1])
    elif i == N - 1:
        gcd_lr[i] = gcd_l[i - 1]

print(max(gcd_lr))

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

N = int(input())
A = list(map(int, input().strip().split(' ')))


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


max_gcd = 0

for i in range(N):
    popped = A.pop(i)
    tmp_max_gcd = gcd_list(A)
    if tmp_max_gcd > max_gcd:
        max_gcd = tmp_max_gcd
    A.insert(i, popped)

print(max_gcd)

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

N = int(input())
A = list(map(int, input().strip().split(' ')))


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


max_gcd = 0

for i in range(N):
    popped = A.pop(i)
    tmp_max_gcd = gcd_list(A)
    if tmp_max_gcd > max_gcd:
        max_gcd = tmp_max_gcd
    A.append(popped)

print(max_gcd)
Problem p03206 (python)

Fixed submission:
D=input()
intD=int(D)
if intD==25:
    print('Christmas')
elif intD==24:
     print('Christmas Eve')
elif intD==23:
    print('Christmas Eve Eve')
elif intD==22:
    print('Christmas Eve Eve Eve')
else:
    print('Error')

Buggy submission (verdict: Runtime Error):
N,X=(int(x) for x in input().split())
tmp='P'
for i in range(N):
    tmp='B'+tmp+'P'+tmp+'B'
print(tmp[0:X].count('P'))

Buggy submission (verdict: Runtime Error):
N,X=(int(x) for x in input().split())
burger=[]
burger.append('P')
for i in range(N):
    burger.append('B'+burger[-1]+'P'+burger[-1]+'B')
print(burger[-1][0:X].count('P'))
Problem p03280 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
counter = 0
for i in range(K + 1):
    if int(S[i]) != 1:
        log = counter
        num = int(S[i])
        break
    counter += 1

if K <= log:
    print(1)
else:
    print(num)

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
# def yakusuu(x):
#     tmplist=list(sy.factorint(x).values())
#     a=1
#     for i in tmplist:
#         a*=i+1
#     return a
def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]
def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num
counter=0
for i in range(1,N+1,2):
    if search_divisor_num_1(i)==8:
        counter+=1
print(counter)
Problem p03281 (python)

Fixed submission:
import math

N = int(input())


# def yakusuu(x):
#     tmplist=list(sy.factorint(x).values())
#     a=1
#     for i in tmplist:
#         a*=i+1
#     return a
def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0  # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]


def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num


counter = 0
for i in range(1, N + 1, 2):
    if search_divisor_num_1(i) == 8:
        counter += 1
print(counter)

Buggy submission (verdict: Runtime Error):
import sympy as sy
N=int(input())
def yakusuu(x):
    tmplist=list(sy.factorint(x).values())
    a=1
    for i in tmplist:
        a*=i+1
    return a
counter=0
for i in range(1,N+1,2):
    if yakusuu(i)==8:
        counter+=1
print(counter)
Problem p03282 (python)

Fixed submission:
S = input()
K = int(input())
counter = 0
num = 1
log = 0
for i in S:
    if int(i) != 1:
        log = counter
        num = int(i)
        break
    counter += 1

if K <= log:
    print(1)
else:
    print(num)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
counter = 0
num = 0
log = 0
for i in range(101):
    if int(S[i]) != 1:
        log = counter
        num = int(S[i])
        break
    counter += 1

if K <= log:
    print(1)
else:
    print(num)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
counter = 0
num=0
log=0
for i in range(K + 1):
    if int(S[i]) != 1:
        log = counter
        num = int(S[i])
        break
    counter += 1

if K <= log:
    print(1)
else:
    print(num)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
counter = 0
for i in range(K + 1):
    if int(S[i]) != 1:
        log = counter
        num = int(S[i])
        break
    counter += 1

if K <= log:
    print(1)
else:
    print(num)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
counter = 0
for i in S:
    if int(i) != 1:
        log = counter
        num = int(i)
        break
    counter += 1

if K <= log:
    print(1)
else:
    print(num)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
counter = 0
for i in S:
    if int(i) != 1:
        log = counter
        num = int(i)
        break
    counter += 1

if K == 1:
    print(S[0])
elif K <= log:
    print(1)
else:
    print(num)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
a = 10 ** 18
print(a)
counter = 0
for i in S:
    if int(i) != 1:
        log = counter
        num = int(i)
        break
    counter += 1

if K == 1:
    print(S[0])
elif K <= log:
    print(1)
else:
    print(num)

Buggy submission (verdict: Runtime Error):
S=input()
K=int(input())
counter=0
for i in S:
    if int(i)!=1:
        log=counter
        num=int(i)
        break
    counter+=1

if K==1:
    print(S[0])
elif K<=log:
    print(1)
else:
    print(num)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
A*B
Problem p02972 (python)

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

from math import ceil

n = int(input())
a = list(map(int,input().split()))
b = ['0'] * (n+1)
    
for i in reversed(range(0, n)):
    d = n // (i+1)
    cn = 0
    for j in range(2, d+1):
        if b[j*(i+1)] == '1':
            cn += 1
    if cn % 2 == a[i]:
        b[i+1] = '0'
    else:
        b[i+1] = '1'
print(b.count('1'))
ee = []
for i,v in enumerate(b):
    if i == 0:
        continue
    if v == '1':
        ee.append(str(i))
print(' '.join(ee))

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

n = int(input())
a = list(map(int,input().split()))
b = ['0'] * (n+1)
c = ceil((n+1)/2)-1
for i in range(c, n):
    if a[i] == 1:
        b[i+1] = '1'
    else:
        b[i+1] = '0'
    
for i in reversed(range(0, c)):
    d = n // (i+1)
    cn = 0
    for j in range(1, d+1, i+1):
        if b[j] == '1':
            cn += 1
    if cn % 2 == a[i]:
        b[i+1] = '0'
    else:
        b[i+1] = '1'
print(b.count('1'))
del b[0]
ee = []
for i,v in enumerate(b):
    if v == '1':
        ee.append(i)
print(' '.join(ee))
Problem p03076 (python)

Fixed submission:
a = [int(input()) for x in range(5)]
sum = 0
b = []
for i in range(5):
    if a[i]%10 == 0:
        sum += a[i]
    else:
        c = a[i] + (10 -a[i]%10)
        sum += c
        b.append(a[i]%10)
if b != []:
    b.sort()
    sum -= 10 - b[0]
print(sum)

Buggy submission (verdict: Runtime Error):
a = [int(input()) for x in range(5)]
sum = 0
b = []
for i in range(5):
    if a[i]%10 == 0:
        sum += a[i]
    else:
        c = a[i] + (10 -a[i]%10)
        sum += c
        b.append(a[i]%10)
if b is not None:
    b.sort()
    sum -= 10 - b[0]
print(sum)

Buggy submission (verdict: Runtime Error):
a = [int(input()) for x in range(5)]
sum = 0
b = []
for i in range(5):
    if a[i]%10 == 0:
        sum += a[i]
    else:
        c = a[i] + (10 -a[i]%10)
        sum += c
        b.append(a[i]%10)
b.sort()
sum -= 10 - b[0]
print(sum)
Problem p03086 (python)

Fixed submission:
s = input()
l = []
for i in range(len(s)):
    if s[i] == 'A' or s[i] == 'T' or s[i] == 'G' or s[i] == 'C':
        l.append(1)
    else:
        l.append(0)
tmp = 0
counter = []
for i in range(len(l)):
    if l[i] == 0:
        counter.append(tmp)
        tmp = 0
    else:
        if i == len(l) - 1:
            tmp += 1
            counter.append(tmp)
        else:
            tmp += 1

print(max(counter))

Buggy submission (verdict: Runtime Error):
s = input()
l = []
for i in range(len(s)):
    if s[i] == 'A' or s[i] == 'T' or s[i] == 'G' or s[i] == 'C':
        l.append(1)
    else:
        l.append(0)
tmp = 0
counter = []
for i in range(len(l)):
    if l[i] == 0:
        counter.append(tmp)
        tmp = 0
    else:
        tmp += 1

print(max(counter))
Problem p03145 (python)

Fixed submission:
i = list(map(int, input().split())) #i_1 i_2を取得し、iに値を入れる
print(int((i[0] * i[1]) / 2))

Buggy submission (verdict: Runtime Error):
s = input().split() #s_1 s_2を分割して取得し、sに値を入れる
print(s[0] * s[1] / 2)
Problem p03238 (python)

Fixed submission:
age = int(input())
if age == 1:
    print('Hello World')
    
if age == 2:
    s = [int(input()) for i in range(2)]
    print(int(s[0] + s[1]))

Buggy submission (verdict: Runtime Error):
s = [int(input()) for i in range(3)]
if s[0] == 1:
    print('Hello World')
if s[0] == 2:
    print(int(s[1] + s[2]))
Problem p03284 (python)

Fixed submission:
n,k = map(int, input().split())
if n%k==0:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
n,k = map(int(), input().split())
if n%k==0:
    print(0)
else:
    print(1)
Problem p03359 (python)

Fixed submission:
a,b = map(int,input().split())
if b<a:
    print(a-1)
else:
    print(a)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
if b<a:
    print(a)
else:
    print(a-1)
Problem p03415 (python)

Fixed submission:
c = [0,0,0]
for i in range(3):
    c[i] = list(input().split())
    
print(c[0][0][0]+c[1][0][1]+c[2][0][2])

Buggy submission (verdict: Runtime Error):
c1 = list(input().split())
c2 = list(input().split())
c3 = list(input().split())

print(c1[0]+c2[1]+c3[2])
Problem p03555 (python)

Fixed submission:
C1 = input()
C2 = input()

if C1[0]==C2[2] and C1[1]==C2[1] and C1[2]==C2[0]:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
C1 = list(input().split())
C2 = list(input().split())

if C1[0]==C2[2] and C1[1]==C2[1] and C1[2]==C2[0]:
    print('YES')
else:
    print('NO')
Problem p03609 (python)

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

if xt[0]-xt[1]>=0:
    print(xt[0]-xt[1])
else:
    print(0)

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

if xt[0]-xt[1]>=0:
    print(xt[0]-xt[1])
else:
    print(0)print(xt[0]-xt[1])
Problem p03777 (python)

Fixed submission:
ab = list(input().split())

if ab[0] == "H" and ab[1] == "H":
    print("H")
    
elif ab[0] == "H" and ab[1] == "D":
    print("D")
    
elif ab[0] == "D" and ab[1] == "H":
    print("D")
    
elif ab[0] == "D" and ab[1] == "D":
    print("H")

Buggy submission (verdict: Runtime Error):
if ab[0] == "H" and ab[1] == "H":
    print("H")
    
elif ab[0] == "H" and ab[1] == "D":
    print("D")
    
elif ab[0] == "D" and ab[1] == "H":
    print("D")
    
elif ab[0] == "D" and ab[1] == "D":
    print("H")
Problem p03944 (python)

Fixed submission:
whn = list (map(int, input().split()))
x = 0
y = 0
flag = 0

for i in range(whn[2]):
    xya = list(map(int,input().split()))
    if xya[2] == 1:
        x = max(x, xya[0])
    elif xya[2] == 2:
        whn[0] = min(whn[0], xya[0])
    elif xya[2] == 3:
        y = max(y, xya[1])
    else:
        whn[1] = min(whn[1], xya[1])
    if x >= whn[0] or y >= whn[1]:
        print(0)
        flag += 1
        break
        
if flag == 0:
    print((whn[0]-x)*(whn[1]-y))

Buggy submission (verdict: Runtime Error):
whn = list (map(int, input().split()))
x = 0
y = 0

for i in range(len(whn[2])):
    xya = list(map(int,input().split()))
    if xya[2] == 1:
        x = max(x, xya[0])
    elif xya[2] == 2:
        whn[0] = min(whn[0], xya[0])
    elif xya[2] == 3:
        y = max(y, xya[0])
    else:
        whn[1] = min(whn[1], xya[1])

print((whn[0]-x)*(whn[1]-y))
Problem p04043 (python)

Fixed submission:
s = input().split() #s_1 s_2を分割して取得し、sに値を入れる
five = 0
seven = 0
for i in range(3):
    if s[i] == '5':
        five += 1
    if s[i] == '7':
        seven += 1
        
if five == 2 and seven == 1:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
s = input().split() #s_1 s_2を分割して取得し、sに値を入れる
five = 0
seven = 0
for i range(3):
    if s[i] == '5':
        five += 1
    if s[i] == '7':
        seven += 1
        
if five == 2 and seven == 1:
    print('YES')
else:
    print('NO')
Problem p02924 (python)

Fixed submission:
N = int(input())
print(int((N*(N-1))//2))

Buggy submission (verdict: Runtime Error):
N = int(input())
    print(int((N*(N-1))//2))
Problem p02957 (python)

Fixed submission:
#ABC135A - Harmony
A, B = list(map(int,input().split()))
if (max(A,B) - min(A,B)) % 2 == 1:
    print("IMPOSSIBLE")
else:
    print((A+B)//2)

Buggy submission (verdict: Runtime Error):
#ABC135A - Harmony
A, B = list(map(int,input().split()))
if (max(A,B) - min(A,B)) % 2 == 1:
    print("IMPOSSIBLE")
else:a
    print((A+B)//2)

Buggy submission (verdict: Runtime Error):
#ABC135A - Harmony
import math
A, B = list(map(int,input().split()))
if math.abs(A-B) % 2 == 1:
    print("IMPOSSIBLE")
else:
    print((A+B)//2)
Problem p02993 (python)

Fixed submission:
#ABCA - Security
a = str(input())
s = list(a)
count = 0
for i in range(3):
    if s[i] != s[i+1]:
        count += 1
if count == 3:
    print("Good")
else:
    print("Bad")

Buggy submission (verdict: Runtime Error):
#ABCA - Security
a = int(input())
s = list(a)
count = 0
for i in range(3):
    if s[i] != s[i+1]:
        count += 1
if count == 3:
    print("Good")
else:
    print("Bad")
Problem p03290 (python)

Fixed submission:
#ABC104C - All Green
import math
def dfs(i,s,c,r):
    global ans
    if i == d:
        if s < g:
            use = max(r)
            n = min(pc[use -1][0], math.ceil((g-s)/(use*100)))
            c += n
            s += n*use*100
        if s >= g:
            ans = min(ans,c)
    
    else:
        dfs(i+1, s, c, r)
        dfs(i+1, s+ pc[i][0]*(i+1)*100+pc[i][1],c+pc[i][0],r-{i+1})
        
d,g = list(map(int,input().split()))
pc = [list(map(int,input().split())) for i in range(d)]

ans = float("inf")

dfs(0,0,0,set(range(1,d+1)))
print(ans)

Buggy submission (verdict: Runtime Error):
#ABC104C - All Green
import math
def dfs(i,s,c,r):
    global ans
    if i == d:
        if s < g:
            use = max(r)
            n = min(pc[use -1][0], math.ceil((g-s)/(use*100)))
            c += n
            s += n+use*100
        if s >= g:
            ans = min(ans,c)
    
    else:
        dfs(i+1, s, c, r)
        dfs(i+1, s+ pc[i][0]*(1+1)*100+pc[i][1],c+pc[i][0],r-{i+1})
        
d,g = list(map(int,input().split()))
pc = [list(map(int,input().split())) for i in range(d)]

ans = float("inf")

dfs(0,0,0,set(range(1,d+1)))
print(ans)
Problem p03565 (python)

Fixed submission:
import sys
S = list(input())
T = list(input())

n = len(S)
m = len(T)

for i in range(n-m,-1,-1):
    K = []
    K = S[i:i+m]
    #print(K)
    for j in range(m):
        if K[j] == "?":
            K[j] = T[j]
    if K == T:
        print("".join((S[:i]+T+S[i+m:])).replace("?","a"))
        sys.exit()

print("UNRESTORABLE")

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

a = len(s)
b = len(t)
#最小の文字列となるためには前にaを固めたほうが良いため後ろから入れる
for i in range(a-b,-1,-1):
    t_kamo = s[i:i+b]
    count = 0
    for j in range(b):
        if t_kamo[j] == t[j] or t_kamo[j] == "?":
            count += 1
    if count == b:
        #replaceメソット(リストには使えない,strに直接使う？)
        #条件分で記述
        ans = "".join(s[:i]+t+s[i+b:])
        print(ans.replace("?","a"))
        sys.exit()
        #ans = []"a" if "?" for i in ans]
        #print("join.(ans)")でもいけるはず
        
print("UNRESTORABLE")
Problem p03722 (python)

Fixed submission:
import sys
 
inf = float('inf')
 
n, m = map(int, sys.stdin.readline().split())
abc = []
for _ in range(m):
    a, b, c = map(int, sys.stdin.readline().split())
    abc.append((a-1, b-1, -c))
 
def main():
    dist = [inf] * n
    dist[0] = 0
    for _ in range(n-1):
        for a, b, c in abc:
            dist[b] = min(dist[b], dist[a] + c)
 
    for _ in range(n):
        for a, b, c in abc:
            if dist[a] + c < dist[b]:
                dist[b] = -inf
 
    return -dist[n-1]
 
if __name__ == '__main__':
    ans = main()
    print(ans)

Buggy submission (verdict: Runtime Error):
#ABC061D - Score Attack
#https://atcoder.jp/contests/abc061/tasks/abc061_d
#自己考察

import sys
n, m = list(map(int,input().split()))
lst = [[] for _ in range(n+1)]#*(n+1)の挙動がよくわからない
for i in range(n):
    a, b, c = list(map(int,input().split()))
    lst[a].append((b,-c))
dp = [float("Inf")]*(n+1)
dp[1] = 0

for _ in range(n):
    for f in range(1,n+1):
        if dp[f] != float("Inf"):
            for t, c in lst[f]:
                dp[t] = min(dp[t], dp[f] + c)

for f in range(1,n+1):
    for t,c in lst[f]:
        if dp[t] > dp[f] + c:
            print("inf")
            sys.exit()

print(-dp[n])
Problem p04001 (python)

Fixed submission:
#arc061_C - たくさんの数式 / Many Formulas
s = list(str(input()))
l = len(s)
def dfs(i,f):
    if i == l-1:
        return sum(list(map(int,f.split("+"))))
    #この記号の正体を教えて下さい
    return dfs(i + 1, f + s[i+1]) + \
           dfs(i + 1, f + "+" +s[i + 1])
print(dfs(0,s[0]))

Buggy submission (verdict: Runtime Error):
#arc061_C - たくさんの数式 / Many Formulas
s = list(str(input()))
l = len(s)
def dfs(i,f):
    if i == l-1:
        return sum(list(map(int,f.split("+"))))
    return dfs(i + 1, f + s[i+1]) + \ #この記号の正体を教えて下さい
           dfs(i + 1, f + "+" +s[i + 1])
print(dfs(0,s[0]))
Problem p03861 (python)

Fixed submission:
import math;
a,b,x = map(long, raw_input().split());
if(a%x == 0):
    a-=1;
A = long(math.ceil(a/x));
B = long(b//x);
print(B-A);

Buggy submission (verdict: Runtime Error):
a,b,x = map(int, raw_input().split());
cnt = 0;
for i in range(a,b+1):
    if(i%x == 0):
        cnt+=1;
print(cnt);
Problem p02657 (python)

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

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

ans = 1
for n in nums:
  ans *= n

if ans == 0:
  print(0)
elif ans > 10**18:
  print(-1)
else:
  print(ans)
Problem p04043 (python)

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

import sys
  
if sorted(sys.stdin.readline().split()) == ['5', '5', '7']:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

n, k = map(int, input().split())
D = list(map(int, input().split()))

paid = n
while True:
    st = set(int(x) for x in str(paid))
    l = len(st)
    if len([x for x in st if x not in D]) == l:
        print(paid)
        break
    paid += 1

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

n, k = map(int, input().split())
D = list(map(int, input().split()))

price = n
while True:
    st = set(int(x) for x in str(price))
    l = len(st)
    if len([x for x in st if x not in D]) == l:
        print(price)
        break
    price += 1

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

import sys

n, k = map(int, input().split())
D = list(map(int, input().split()))

for i in range(1, 100):
    total = n * i
    st = set(int(x) for x in str(total))
    l = len(st)
    if len([x for x in st if x not in D]) == l:
        print(total)
        break

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

n, l = map(int, input().split())
s = []

for _ in range(n):
    s.append(str(input()))

print(''.join(sorted(s)))

Buggy submission (verdict: Runtime Error):
import sys
import os

def judge_575(args):
    count5 = [int(x) for x in args ].count(5)
    count7 = [int(x) for x in args ].count(7)
    if count5 == 2 and count7 == 1:
        print('YES')
        return

    print('NO')

if __name__ == "__main__":
    if len(sys.argv) < 4:
        print('NO')
        os.exit(0)

    judge_575(sys.argv[1:])
Problem p03126 (python)

Fixed submission:
n,m = map(int,input().split())
food = [0 for i in range(m+1)]
for i in range(n):
    a = input().split()
    for j in range(1,int(a[0])+1):
        food[int(a[j])] += 1
count = 0
for i in food:
    if i == n:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
food = [0 for i in range(m+1)]
for i in range(n):
    a = input().split()
    for j in range(1,int(a[0])):
        food[int(a[j])] += 1
count = 0
for i in food:
    if i = n:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
food = [0 for i in range(m+1)]
for i in range(n):
    a = input().split()
    for j in range(0,int(a[0])):
        food[int(a[j])] += 1
count = 0
for i in food:
    if i = n:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
food = [0 for i in range(m)]
for i in range(n):
    a = input().split()
    for j in range(0,int(a[0])):
        food[int(a[j])] = 1
print(food.index(0)+1)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
food = [0 for i in range(m)]
for i in range(n):
    k = int(input())
    for j in range(k):
        food[int(input())] = 1
print(food.index(0))
Problem p02657 (python)

Fixed submission:
tmp = input().split()
ans = int(tmp[0]) * int(tmp[1])
print(ans)

Buggy submission (verdict: Runtime Error):
tmp = input().split()
   ans = tmp[0] * tmp[1]
  print(ans)