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

Fixed submission:
n = int(raw_input())
a = raw_input().split()

cnt = 0
for i in a:
    a[cnt] = int(i)
    cnt += 1

chk = {}
chk2 = {}
def make_divisors(k):
    divisors = []
    for i in range(1, int(k**0.5)+1):
        if k % i == 0:
            if i in chk:
                chk[i] += 1
            else:
                chk[i] = 1
            if i != k // i:
                key = int(k//i)
                if key in chk:
                    chk[key] += 1
                else:
                    chk[key] = 1
    return divisors

for i in range(2):
    make_divisors(a[i])
cnt = 1
for i in range(2,len(a)):
    k = a[i]
    if k not in chk2:
        chk2[k] = 1
    else:
        if chk2[k] == 1:
            chk2[k] += 1
        elif chk2[k] > 1:
            continue
    del_list = []
    for j in chk:
        if k % j == 0:
            chk[j] += 1
        if chk[j] < cnt+1:
            del_list.append(j)
    for j in del_list:
        del chk[j]
    cnt += 1

answer = 0
for i in chk:
    if int(chk[i]) >= chk[1] - 1 and i > answer:
        answer = i
print answer

Buggy submission (verdict: Runtime Error):
n = int(raw_input())
a = raw_input().split()

cnt = 0
for i in a:
    a[cnt] = int(i)
    cnt += 1

chk = {}
def make_divisors(k):
    divisors = []
    for i in range(1, int(k**0.5)+1):
        if k % i == 0:
            if i in chk:
                chk[i] += 1
            else:
                chk[i] = 1
            if i != k // i:
                key = int(k//i)
                if key in chk:
                    chk[key] += 1
                else:
                    chk[key] = 1

    return divisors

if n == 2:
    print max(a[0],a[1])
else:
    for i in range(2):
        make_divisors(a[i])
    cnt = 1
    for i in range(2,len(a)):
        k = a[i]
        del_list = []
        for j in chk:
            if k % j == 0:
                chk[j] += 1
            if chk[j] < cnt+1:
                del_list.append(j)
#        for j in del_list:
#            del chk[j]
        cnt += 1

#    answer = max(chk.keys())
    for i in chk:
        if int(chk[i]) >= n - 1 and i > answer:
            answer = i
    print answer
Problem p03071 (python)

Fixed submission:
ar = []                                            
raw = raw_input().split()                          
#ar.append(int(raw))                               
#raw = raw_input()                                 
#raw = raw_input()                                 
#ar.append(int(raw))                               
#raw = raw_input()                                 
#ar.append(int(raw))                               
#raw = raw_input()                                 
#ar.append(int(raw))                               
#raw = raw_input()                                 
#ar.append(int(raw))                               




#n = ar[0]                                         
a = int(raw[0])                                    
b = int(raw[1])
#c = ar[3]
#d = ar[4]
#e = ar[5]                                         

first = max(a,b)                                   

if ( a > b):                                       
    a -= 1                                         
else:
    b -= 1                                         


second = max(a,b)                                  

print first + second

Buggy submission (verdict: Runtime Error):
import math                                                                                            

n,k = raw_input().split()
s = list(raw_input())


cnt = 0

prev = ''
tmp = ''
ar = []
for i in s:
    if i == '0' and prev !=  1:
        tmp += '0'
        prev = 0
    elif i == '0' and prev == 1:
        prev = 0
        ar.append(tmp)
        tmp = '0'
    elif i == '1' and prev != 0:
        tmp += '1'
        prev = 1
    elif i == '1' and prev == 0:
        prev = 1
        ar.append(tmp)
        tmp = '1'

ar.append(tmp)
k = int(k)


j = 0
cnt = 0
total = 0
m = 0

for i in ar:
    total += len(i)
    if '0' in i:
        cnt += 1
    if '0' in i and cnt == k + 1:
        total = total - (len(ar[j-2*k]) + len(ar[j-2*k-1]))                                            
        cnt = k                                    
    m = max(m, total)
    j += 1

print m
Problem p03145 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,imput().split())
print(a*b//2)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,imput().split())
print(a*b/2)
Problem p03399 (python)

Fixed submission:
a,b,c,d = [int(input()) for _ in range(4)]
print(min(a,b) + min(c,d))

Buggy submission (verdict: Runtime Error):
a,b,c,d = [int(input()) for _ in renge(4)]
print(min(a,b) + min(c,d))

Buggy submission (verdict: Runtime Error):
a,b,c,d = [int(input) for _ in renge(4)]
print(min(a,b) + min(c,d))
Problem p04044 (python)

Fixed submission:
n,l = map(int,input().split())
s = sorted([input() for i in range(n)])
print(*s,sep="")

Buggy submission (verdict: Runtime Error):
n,l = map(int,input().split())
s = sorted([input() for i in range(n)])
print(*s,seq="")
Problem p02818 (python)

Fixed submission:
a,b,k = map(int,input().split())
if a - k >= 0 :
    print(a - k,b)
elif a + b - k >= 0  :
    print(0,b-(k-a))
else:
    print(0,0)

Buggy submission (verdict: Runtime Error):
value = input()
list = value.split()
A = int(list[2] - list[0])
print(int(list[1]) - A)
Problem p02817 (python)

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

Buggy submission (verdict: Runtime Error):
s,t = input.split()
print(t.lower()+s.lower())

Buggy submission (verdict: Runtime Error):
s,t = raw_input.split()
print(t.lower() + s.lower())

Buggy submission (verdict: Runtime Error):
s,t = raw_input.split()
print(t+s)

Buggy submission (verdict: Runtime Error):
print(''.join(sorted(S+T)))

Buggy submission (verdict: Runtime Error):
print(''.join(sorted(S+T)))
Problem p02981 (python)

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

if N*A < B:
  print(N*A)
else:
  print(B)

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

listX = []
sw = 0
i = 1
for i in range(1, 990590):
  listX.append(i*2019)

for n in range(len(listX)):
  if L < listX[n] and R > listX[n]:
    sw += 1

if sw > 0:
  print(0)

elif sw == 0:      
  L_1 = L % 2019
  R_1 = R % 2019
  
  idx1 = 0
  listA = []
  for idx1 in range(L_1, R_1):
    for idx2 in range(idx1 + 1, R_1 + 1):
      listA.append(idx1 * idx2)
 
  print(min(listA))
Problem p02983 (python)

Fixed submission:
L, R = map(int, input().split())

listX = []
for i in range(1, 990590):
  listX.append(i*2019)

sw = 0
for n in range(len(listX)):
  if L < listX[n] and R > listX[n]:
    sw += 1

if sw > 0:
  print(0)

elif sw == 0:
  idx1 = 0
  listA = []
  for idx1 in range(L, R):
    for idx2 in range(idx1 + 1, R + 1):
      listA.append(idx1 * idx2)
 
  idx3 = 0
  listB = []
  for idx3 in range(len(listA)):
    listB.append(listA[idx3] % 2019)
 
  print(min(listB))

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

listX = []
sw = 0
i = 1
while i * 2019 > 2000000000:
  i3 = i *2019
  listX.append(i3)
  i += 1

for n in range(len(listX)):
  if L < listX[n] and R > listX[n]:
    sw += 1

if sw > 0:
  print(0)

elif sw == 0:      
  L_1 = L % 2019
  R_1 = R % 2019
  
  idx1 = 0
  listA = []
  for idx1 in range(L_1, R_1):
    for idx2 in range(idx1 + 1, R_1 + 1):
      listA.append(idx1 * idx2)
 
  print(min(listA))

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

listX = []
sw = 0
for i in range(99050):
  listX.append(i*2019)

for n in range(len(listX)):
  if L < listX[n] and R > listX[n]:
    sw += 1

if sw > 0:
  print(0)

else:      
  L_1 = L % 2019
  R_1 = R % 2019
  
  idx1 = 0
  listA = []
  for idx1 in range(L_1, R_1):
    idx2 = idx1 + 1
    for idx2 in range(idx1 + 1, R_1 + 1):
      listA.append(idx1 * idx2)
 
  print(min(listA))

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

if L < 2019 and R > 2019:
  print(0)

else:
  L_1 = L % 2019
  R_1 = R % 2019
  
  idx1 = 0
  listA = []
  for idx1 in range(L_1, R_1):
    idx2 = idx1 + 1
    for idx2 in range(idx1 + 1, R_1 + 1):
      listA.append(idx1 * idx2)
 
  print(min(listA))

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

L_1 = L % 2019
R_1 = R % 2019

idx1 = 0
listA = []
for idx1 in range(L_1, R_1):
  idx2 = idx1 + 1
  for idx2 in range(idx1 + 1, R_1 + 1):
    listA.append(idx1 * idx2)

print(min(listA))
Problem p02842 (python)

Fixed submission:
import math

s = int(input())

te = s % 1.08
if te < 0.1:
  print(':(')
else:
  x = s / 1.08
  print(math.ceil(x))

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

if s % 1.08 < 0.1:
  print(':(')
else:
  x = s // 1.08
  x = int(x)
  print(x)

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

x = s / 1.08

rx = round(x)
tashikame = rx * 1.08
tashikames = math.floor(tashikame)
tashikames = int(tashikames)
if s != tashikames:
  print(':(')
else:
  x = int(x)
  print(x)

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

x = s / 1.08

rx = round(x)
tashikame = rx * 1.08
tashikames = math.floor(tashikame)
tashikames = int(tashikames)
if s != tashikames:
  print(':(')
else:
  print(x)

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

x = s / 1.08

tashikame = round(x) * 1.08
tashikame = math.floor(tashikame)
if s != tashikame:
    print(':(')
else:
    print(x)
Problem p02817 (python)

Fixed submission:
S,T = input().split()

print(T + S)

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

m = T + S
            
print(m)
Problem p02818 (python)

Fixed submission:
At,Ba,K = (int(x) for x in input().split())

if K <= At:
    print(At - K)
    print(Ba)
elif K <= At + Ba:
    print(0)
    print(Ba - (K - At))
else :
    print(0)
    print(0)

Buggy submission (verdict: Runtime Error):
At = int(input())
Ba = int(input())
K = int(input())

for i in range(K):
    if At >= 1:
        At -= 1
    elif Ba >= 1:
        Ba -= 1
    
print(At)
print(Ba)

Buggy submission (verdict: Runtime Error):
At = int(input())
Ba = int(input())
K = int(input())

for i in range(K):
    if At >= 1:
        At -= 1
    elif Ba >= 1:
        Ba -= 1
    
print(At)
print(Ba)
Problem p02921 (python)

Fixed submission:
S = input()
T = input()

count = 0

for i in range(3):
    if(S[i] == T[i]):
        count += 1
        
if(count == 0):
    print(0)
elif(count == 1):
    print(1)
elif(count == 2):
    print(2)
else:
    print(3)

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

count = None

for i in range(3):
    if(S[i] == T[i]):
        count += 1
        
if(count == 0):
    print(0)
elif(count == 1):
    print(1)
elif(count == 2):
    print(2)
else:
    print(3)
Problem p03030 (python)

Fixed submission:
n=int(input())
sp=[]
for i in range(n):
    s,p=input().split()
    sp.append([s,int(p),i+1])
    
sort=sorted(sp, key=lambda sp: (sp[0], -sp[1]))

for i in sort:
    print(i[2])

Buggy submission (verdict: Runtime Error):
n=int(input())
sp=[]
for i in range(n):
    s,p=input().split()
    sp.append([s,int(p),i+1])
    
sort=sorted(sp, key=lambda sp: (sp[0], -sp[1]))

for i in range(sort):
    print(i[2])

Buggy submission (verdict: Runtime Error):
n=int(input())
sp=[]
for i in range(n):
    s,p=input().split()
    sp.append([s,int(p),i+1])
    
sort=sorted(sp, key=lambda sp: sp[0], -sp[1])

for i in range(sort):
    print(i[2])
Problem p03087 (python)

Fixed submission:
N,Q=map(int,input().split())
S=input()
count=[0]*N
for i in range(1,N):
    count[i]+=count[i-1]
    if S[i-1:i+1]=="AC":count[i]+=1
for i in range(Q):
    l,r=map(int,input().split())
    print(count[r-1]-count[l-1])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
count=[]*n
for i in range(1,n):
    count[i]+=count[i-1]
    if S[i-1:i+1]=="AC":
        count[i]+=1

for i in range(q):
    l,r=map(int,input().split())
    print(count[r-1]-count[l-1])
Problem p03126 (python)

Fixed submission:
n,m= map(int, input().split())
k=[]*n
a=[]*n
s=set(range(1,m+1))
for i in range(n):
    tmp=list(map(int, input().split()))
    a=tmp[1:]
    s= s & set(a)

print(len(s))

Buggy submission (verdict: Runtime Error):
n,m= map(int, input().split())
k=[]*n
a=[]*n
s=set(range(1,M+1))
for i in range(n):
    tmp=list(map(int, input().split()))
    a=tmp[1:]
    s= s & set(a)

print(len(s))

Buggy submission (verdict: Runtime Error):
n,m= map(int, input().split())
k=[]*n
a=[]*n
s=set(range(1,M+1))
for i in range(n):
    tmp=list(map(int, input().split()))
    k[i]=tmp[0]
    a[i]=tmp[1:]
    s= s & set(a[i])

print(len(s))

Buggy submission (verdict: Runtime Error):
n,m= map(int, input().split())
k=[]*n
a=[]*n
s=set(range(1,M+1))
for i in range(n):
    tmp=list(map(int, input().split()))
    k[i]=tmp[0]
    a[i]=tmp[0:]
    s= s & set(a[i])

print(len(s))
Problem p03408 (python)

Fixed submission:
N=int(input())
s = [input() for _ in range(N)]
M=int(input())
t = [input() for _ in range(M)]

l = list(set(s)) 

cnt=0
for k in range(len(l)):
    cnt = max(cnt, s.count(l[k]) - t.count(l[k]))

print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
s = [input() for _ in range(N)]
M=int(input())
t = [input() for _ in range(M)]

l = list(set(s)) 

for k in range(len(l)):
    cnt = max(cnt, s.count(l[k]) - t.count(l[k]))

print(cnt)
Problem p03494 (python)

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

ans = 0
t=0

while True:
    for i in range(n):  # 0 1 2 ... n-1
        if a[i] %2 ==0:
            a[i] = a[i] / 2
        else:
            t = 1
    if t != 1:
        ans += 1
    else:
        break

print(ans)

Buggy submission (verdict: Runtime Error):
n = input() # データの個数
a = input().split() #リストに文字列として格納
t = 0

while True:
  for i in len(n):
    if int(a(i-1)) % 2 == 0:
      a(i-1) = int(a(i-1)/2)
      if i ==n:
        t += 1
      else:
        pass
    else:
      break

print(t)

Buggy submission (verdict: Runtime Error):
n = input() # データの個数
a = list(map(int, input().split()))
t = 0

while True:
  for i in len(n):
    if a(i-1) % 2 == 0:
      a(i-1) == a(i-1)/2
      if i ==n:
        t += 1
      else:
        pass
    else:
      break

print(t)
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):
c11, c12, c13 = int(input().split())
c21, c22, c23 = int(input().split())

if c11==c23 and c12==c22 and c13==c21:
  print("YES")
else:
  print("NO")
Problem p03573 (python)

Fixed submission:
a, b, c = map(int, input().split())
 
if a == b:
    print(c)
elif a==c:
    print(b)
elif b==c:
    print(a)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int(input().split()))
 
if a == b:
  print(a)
elif a==c:
  print(a)
elif b==c:
  print(c)

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

if a == b:
  print(a)
elif a==c:
  print(a)
elif b==c:
  print(c)
Problem p03760 (python)

Fixed submission:
O=list(input())
E=list(input()) + [""]

for i in range(len(O)):
    print(O[i], E[i], sep="",end="")

Buggy submission (verdict: Runtime Error):
O=input()
E=input()

for i in range(len(O)):
    print(O[i], E[i], sep="",end="")
Problem p03796 (python)

Fixed submission:
import math
n=int(input())
print(math.factorial(n)%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
print(math.factorial(n)/(10**9+7))
Problem p02921 (python)

Fixed submission:
import sys

s = raw_input()
t = raw_input()

count =0
for i, c in enumerate(s):
    if c == t[i]:
        count += 1
print count

Buggy submission (verdict: Runtime Error):
import sys

s = input()
t = input()

count =0
for i, c in enuemrate(s):
    if c == t[i]:
        count += 1
print count
Problem p03612 (python)

Fixed submission:
import sys
import random


test =False
debug = False
loop = False

def main(N, items):
    counter = 0
    i = 0
    if test:
        print N, items
    if debug:
        print items
    while i < N - 1:
        if i + 1 == items[i]:
            tmp = items[i+1]
            items[i+1] = items[i]
            items[i] = tmp
            counter += 1
            if debug:
                print items
        i += 1
    assert i == N - 1
    if items[i] == N:
        tmp = items[i]
        items[i] = items[i-1]
        items[i-1] = tmp
        counter += 1
        if debug:
            print items
    print counter

if __name__ == "__main__":
    if test:
        if loop:
            while True:
                N = random.randint(2, 10)
                items = range(1, N + 1)
                assert len(items) == N
                random.shuffle(items)
                main(N, items)
        else:
            N = 4
            items = [3,2,1,4]
            main(N, items)
    else:
        N = int(raw_input())
        items = raw_input().split()
        items = [int(item) for item in items]
        main(N, items)

Buggy submission (verdict: Runtime Error):
import sys

test =False
if test:
    N = 9
    items = [1,2,4,9,5,8,7,3,6]
else:
    N = int(raw_input())
    items = raw_input().split()
    items = [int(item) for item in items]
counter = 0
i = 0
if test:
    print items
while i < N:
    if i + 1 == items[i]:
        tmp = items[i+1]
        items[i+1] = items[i]
        items[i] = tmp
        counter += 1
        if test:
            print items
    i += 1
assert i == N
if items[N-1] == N:
    tmp = items[N]
    items[N] = items[N-1]
    items[N-1] = tmp
    counter += 1
    if test:
        print items
print counter
Problem p03633 (python)

Fixed submission:
import sys

def scp(a, b):
    if b > a:
        tmp_a = a
        a = b
        b = tmp_a
    while b:
        r = a % b
        a = b
        b = r
    return a
    #for i in xrange(100000, 2, -1):
    #    if a % i == b % i == 0:
    #        return a * b / i
    #return a * b

N = int(raw_input())
array = []
for i in range(N):
    array.append(int(raw_input()))

array.sort()

#if array[-1] > pow(10, 9):
#    print array[-1]
#    sys.exit(0)

result = array[0]
for i in array[1:]:
    result = result / scp(result, i) * i
print result

Buggy submission (verdict: Runtime Error):
import sys

N = int(raw_input())
array = []
for i in range(N):
    array.append(int(raw_input()))

array.sort()

def euclid(a, b):
    if a == b:
        return a
    if a > b:
        return euclid(a - b, b)
    else:
        return euclid(b - a, a)

result = array[0]
for i in array[1:]:
    result = result * i / euclid(result, i)
print result
Problem p02861 (python)

Fixed submission:
def ints():
  return [int(x) for x in input().split()]
def readi():
  return int(input())

def permutation(a, aa=[]):
  if len(a)<=1:
    return [aa+a]

  res = []
  for x in a:
    b = a.copy()
    b.remove(x)
    res.extend(permutation(b, aa+[x]))

  return res

N = readi()
P = [ints() for i in range(N)]

s = 0.0
ps = permutation(list(range(N)))
pn = len(ps)

for p in ps:
  for i in range(N-1):
    q = p[i]
    r = p[i+1]
    s += ((P[q][0]-P[r][0])**2+(P[q][1]-P[r][1])**2)**(0.5)/pn
print(s)

Buggy submission (verdict: Runtime Error):
def ints():
  return [int(x) for x in input().split()]
def readi():
  return int(input())

def permutation(a, aa=[]):
  if len(a)<=1:
    return [aa+a]

  res = []
  for x in a:
    b = a.copy()
    b.remove(x)
    res.extend(permutation(b, aa+[x]))

  return res


N = readi()
P = [ints() for i in range(N)]

s = 0.0
ps = permutation(list(range(N)))
pn = len(ps)

for p in ps:
  for i in range(N-1):
    q = p[i]
    r = p[i+1]
    s += ((P[q][0]-P[r][0])**2+(P[q][1]-P[r][1])**2)**(0.5)/pn
print(s)
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
n,a,b = map(int, input().split())
print(min(n * a , b)
Problem p02945 (python)

Fixed submission:
a,b= (int(i) for i in input().split()) 
c = a + b
d = a-b
e = a*b

print(max([c,d,e]))

Buggy submission (verdict: Runtime Error):
a = (int(i) for i in input().split()) 
b = a[0] + a[1]
c= a[0] - a[1]
d= a[0] * a[1]

print(max([b,c,d])
Problem p03296 (python)

Fixed submission:
N=int(input())
li = list(map(int,input().split()))
M=0
for i in range(N-1):
	if li[i]==li[i+1]:
		li[i+1]=li[i+1]+10000
		M=M+1
print(M)

Buggy submission (verdict: Runtime Error):
n = int(input())
li=[]
re=[]
for i in range(n):
	li.append(list(map(int,input().split())))
	if li[i][0] >= li[i][1] and li[i][1] <= li[i][3]:
		Lim=li[i][0]%li[i][1]
		if li[i][1] == li[i][3]:
			pass
		else:
			while Lim+li[i][3]-li[i][1]<li[i][1]:
				Lim=Lim+li[i][3]-li[i][1]
		if li[i][2] >= Lim:
			re.append("Yes")
		else:
			re.append("No")
	else:
		re.append("No")
for value in re:
 print(value)
Problem p02817 (python)

Fixed submission:
a, b = (i for i in input().split())
print("{}{}".format(b, a))

Buggy submission (verdict: Runtime Error):
a, b = (int(i) for i in input().split())  
print("{}{}".format(b, a))
Problem p02842 (python)

Fixed submission:
N = int(input())
import math, sys
x = math.floor(N/1.08)
c = [x-1, x, x+1]
C = [i*1.08 for i in c]
for i, j in zip(c, C):
    if math.floor(j) == N:
        print(int(i))
        sys.exit()
print(":(")

Buggy submission (verdict: Runtime Error):
import math, sys
N = int(input())
x = math.floor(N/1.08)
c = [x-1, x, x+1]
C = c*1.08
for i, j in zip(c, C):
    if j == N:
        print(i)
        sys.exit()
print(":(")
Problem p02843 (python)

Fixed submission:
X = int(input())
import sys
q = X // 100
r = X % 100
if r >= 0 and r <= 5 * q:
    print(1)
    sys.exit()
print(0)

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


DP = [0 for i in range(1000000)]
DP[0] = 1
a = [100, 101, 102, 103, 104, 105]
for i in a:
    for j in range(X):
        if DP[j] == 1:
            DP[j + i] = 1
print(DP[X])

Buggy submission (verdict: Runtime Error):
X = int(input())
DP = [0 for i in range(100000)]
DP[0] = 1
a = [100, 101, 102, 103, 104, 105]
for i in a:
    for j in range(X):
        if DP[j] == 1:
            DP[j + i] = 1
print(DP[X])

Buggy submission (verdict: Runtime Error):
X = int(input())
DP = [0 for i in range(100000)]
DP[0] = 1
a = [100, 101, 102, 103, 104, 105]
for i in a:
    for j in range(X):
        if DP[j] == 1:
            DP[j + i] = 1
print(DP[X])
Problem p02844 (python)

Fixed submission:
def solve():
    ans = 1
    N = int(input())
    s = input()
    ans = 0
    for i in range(1000):
        t = str(i).zfill(3)
        t_index = 0 
        for s_index in range(N):
            if s[s_index] == t[t_index]:
                t_index += 1
                if t_index == 3:
                    break
        if t_index == 3:
            ans += 1
    print(ans)
solve()

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
def solve():
    ans = 0
    for i in range(1000):
        t = str(i).zfill(3)
        t_index = 0 
        for s_index in range(N):
            if s[s_index] == t[t_index]:
                t_index += 1
                if t_index == 3:
                    break
        if t_index == 3:
            ans += 1
    print(ans)
solve()
Problem p02917 (python)

Fixed submission:
N = int(input())
B = list(map(int, input().split()))
A = [B[0]]
for i in range(1, N-1):
    A.append(min(B[i], B[i-1]))
A.append(B[N-2])
print(sum(A))

Buggy submission (verdict: Runtime Error):
N = int(input())
B = map(int, input().split())
A = [B[0]]
for i in range(1, N-1):
    A.append(min(B[i], B[i-1]))
A.append(B[N-2])
print(sum(A))