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

Fixed submission:
N,A,B,C=map(int,input().split())
l=[int(input()) for i in range(N)]
inf=10**9
def magic(cur, a, b, c):
    if cur == N:
        if min(a, b, c) > 0:
            return abs(a - A) + abs(b - B) + abs (c - C) - 30
        else:
            return inf
    
    ret0 = magic(cur+1, a, b, c)
    ret1 = magic(cur+1, a+l[cur], b, c) + 10
    ret2 = magic(cur+1, a, b+l[cur], c) + 10
    ret3 = magic(cur+1, a, b, c+l[cur]) + 10
    return min(ret0, ret1, ret2, ret3)

print(magic(0, 0, 0, 0))

Buggy submission (verdict: Runtime Error):
N, A, B, C = map(int,input().split())
l = [int(input()) for i in range(N)]
inf = 10**9

def magic(cur, a, b, c):
    if cur == N:
        if min(a, b, c) > 0:
            return abs(a - A) + abs(b - B) + abs (c - C) - 30
        else:
            return inf
    
    ret0 = magic(cur+1, a, b, c)
    ret1 = magic(cur+1, a+l[cur], b, c) + 10
    ret2 = magic(cur+1, a, b+l[cur], c) + 10
    ret3 = magic(cur+1, a, b, c+l[cur]) + 10
    return min(ret0, ret1, ret2, ret3)

print(magic(ret0, ret1, ret2, ret3)
Problem p03126 (python)

Fixed submission:
import numpy as np

N, M = map(int, input().split())
foods = np.zeros(M)
for i in range(N):
    a = list(map(int, input().split()))
    K = a[0]
    a = a[1:]
    for k in range(K):
      foods[a[k]-1] += 1

ans = np.count_nonzero(foods == N)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

N, M = map(int, input().split())
foods = np.zeros(M)
for i in range(N):
    a = list(map(int, input().split()))
    K = a[0]
    a = a[1:]
    for k in range(K):
      #print("i", i, foods[a[k]])
      foods[a[k]] += 1

#every = N * np.ones(M)
ans = np.count_nonzero(foods == N)
print(ans)
Problem p02732 (python)

Fixed submission:
N = int(raw_input())
A = map(int, raw_input().split())
 
count = [0]*(N+2)
for i in range(N):
    id = A[i]
    count[id] = count[id]+1
 
sumN = long(0)
for i in range(N+1):
    sumN = sumN + long(long(count[i]*(count[i]-1))/2)
 
for i in range(N):
    id = A[i]
    sumz = sumN - (count[id] - 1)
    print(sumz)

Buggy submission (verdict: Runtime Error):
from collections import Counter

N = int(raw_input())
O = list(map(int, raw_input().split()))

cnt = Counter(O)
cnt = dict(cnt)

for k in cnt:
    if cnt[k] == 1:
        del cnt[k]

for i in O:
    cnt[i] = cnt.get(i, 1) - 1
    res = 0

    for k in cnt:
        if cnt[k] >=2:
            res += (cnt[k]*(cnt[k]-1))/2
    print(res)

    cnt[i] += 1
Problem p02813 (python)

Fixed submission:
import itertools

n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

index = []

for i, s in enumerate(itertools.permutations(range(1, n+1),n)):
    if s == p or s == q:
        index.append(i)


if len(index) == 2:
    print(abs(index[0]-index[1]))
else:
    print('0')

Buggy submission (verdict: Runtime Error):
import itertools

n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

index = []

for i, s in enumerate(itertools.permutations(range(1, n+1),n)):
    if s == p or s == q:
        index.append(i)

print(len(index))

if len(index) != 2:
    print(abs(index[0]-index[1]))
else:
    print('0')

Buggy submission (verdict: Runtime Error):
import itertools

n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

index = []

for i, s in enumerate(itertools.permutations(range(1, n+1),n)):
    if s == p or s == q:
        index.append(i)

if len(index) != 0:
    print(abs(index[0]-index[1]))
else:
    print('0')

Buggy submission (verdict: Runtime Error):
import itertools

n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

index = []

for i, s in enumerate(itertools.permutations(range(1, n+1),n)):
    if s == p or s == q:
        index.append(i)

print(abs(index[0]-index[1]))
Problem p02687 (python)

Fixed submission:
x = input()
def f(x):
    if x == "ABC":
        print("ARC")
    elif x == "ARC":
        print("ABC")
    else:
        print("invalid input")
f(x)

Buggy submission (verdict: Runtime Error):
    x = input()
    def f(x):
      if x == "ABC":
        print("ARC")
      elif x == "ARC":
        print("ABC")
      else:
        print("invalid input")
     
    print(f(x))

Buggy submission (verdict: Runtime Error):
x = input()
def f(x):
  if x == ABC:
    print("ARC")
  elif x == ARC:
    print("ABC")
  else:
    print("invalid input")

print(f(x))

Buggy submission (verdict: Runtime Error):
x = input()
if x == ARC:
  print("ABC")
elif x == ABC:
  print("ARC")
else:
  print("invalid input")
Problem p02765 (python)

Fixed submission:
n,r=map(int,input().split())
if n<10:
    r+=100*(10-n)
print(r)

Buggy submission (verdict: Runtime Error):
n,r=map(int(input().split()))
if n<10:
    r+=100*(10-n)
print(r)

Buggy submission (verdict: Runtime Error):
n,r=map(int(input()))
if n<10:
    r+=100*(10-n)
print(r)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
count=0
while n>0:
    count+=1
    n//=k
print(count)
Problem p02817 (python)

Fixed submission:
arr = input().split()
s = arr[0]
t = arr[1]
print(t+s)

Buggy submission (verdict: Runtime Error):
arr = input().split()
s = arr[0]
t = arr[1]
print(f'{t}{s}')
Problem p02714 (python)

Fixed submission:
n = int(input())
s = input()

r = 0
g = 0
b = 0


for ss in s:
    if ss == "R":
        r += 1
    elif ss == "G":
        g += 1
    elif ss == "B":
        b += 1
ng = 0
i = 0
while i < n:
    j = 1
    while i+2*j < n:
        if s[i] != s[i+j] and s[i+j] != s[i+2*j] and s[i] != s[i+2*j]:
            ng += 1
        j += 1
    i += 1
print(r*g*b-ng)

Buggy submission (verdict: Runtime Error):
from functools import lru_cache

@lru_cache(maxsize=1000)
N = int(input())
S =input()
a = 0
for i in range(N-2):
  for j in range(i,N-1):
    for k in range(j,N):
      if S[i] != S[j] and S[i] != S[k] and S[k] != S[j] and j -i != k-j:
        a+= 1
        print(a)
Problem p03470 (python)

Fixed submission:
n = int(input())
print(len(set(map(int, [input() for i in range(n)]))))

Buggy submission (verdict: Runtime Error):
n = int(input())
print(len(set(map(int, [input() for i in range(n)]))
Problem p03478 (python)

Fixed submission:
n, a, b = map(int, input().split())
ans = 0
for i in range(n + 1):
    if a <= sum(list(map(int, list(str(i))))) <=b:
        ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i)))) <= b:
        ans += i
print(ans)
Problem p03494 (python)

Fixed submission:
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for _ in a:
    ans = min(ans, len(bin(_)) - bin(_).rfind("1") - 1)
print(round(ans))

Buggy submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for _ in a:
    ans = min(len(bin(_) - bin(_).rfind("1") - 1)
print(round(ans))
Problem p02817 (python)

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

Buggy submission (verdict: Runtime Error):
# S,T = input().split()
A,B,K = map(int, input().split())
# A = int(input())
# B = int(input())
# C = int(input())
# s= input()
if A >= K:
    print(A - K,B)
elif A + B >=K:
    print(0,A + B - K)
else:
    print(0,0)

Buggy submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
# A = int(input())
# B = int(input())
# C = int(input())
# s= input()
if A >= K:
    print(A - K,B)
elif A + B >=K:
    print(0,A + B - K)
else:
    print(0)
Problem p02909 (python)

Fixed submission:
x = input()
A = ["Sunny","Cloudy","Rainy"]
N = (A.index(x) + 1) % 3
print(A[N])

Buggy submission (verdict: Runtime Error):
X = input()
A = ["Sunny","Cloudy","Rainy"]
N = (index(x) + 1) % 3
print(A.[N])
Problem p02946 (python)

Fixed submission:
K,X = map(int, input().split())
max = X + K 
min = X - K + 1
for i in range(min,max):
    print(i,end=" ")

Buggy submission (verdict: Runtime Error):
K,X = map(int, input().split())
max = X + K - 1
min = X - k + 1
for i in range(min,max):
    print(i,end="\t")
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
N,A,B = map(int,input().split())
print(min(S*N,B))
Problem p03105 (python)

Fixed submission:
A,B,C = map(int,input().split())
print(min(B//A,C))

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input())
print(min(B//A,C))

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input())
min(B//A,C)
Problem p03109 (python)

Fixed submission:
a,b,c = input().split("/")
A = a + b + c
if A <= "20190430" :
    print("Heisei")
else :
    print("TBD")

Buggy submission (verdict: Runtime Error):
a,b,c = input().split(/)
A = a + b + c
if A <= "20190430" :
    print("Heisei")
else :
    print("TBD")
Problem p03206 (python)

Fixed submission:
D = int(input())
print("Christmas" + " Eve" * (25 - D))

Buggy submission (verdict: Runtime Error):
D = int(input().split())
print("Christmas" + "Eve" * (25 - D))

Buggy submission (verdict: Runtime Error):
D = int(input().split())
print("Christmas" + "Eve" * (25 - D)
Problem p03285 (python)

Fixed submission:
N = int(input())
for i in range(26):
    for j in range(15):
        if 4*i + 7*j == N:
            print("Yes")
            exit()
print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
for i in range(26):
    for j in range(15):
        if 4*i + 7*j == N
        print("Yes")
        exit()
print("No")
Problem p03399 (python)

Fixed submission:
A,B,C,D = [int(input()) for i in range(4)]
print(min(A,B) + min(C,D))

Buggy submission (verdict: Runtime Error):
A,B,C,B = [int(input()) for i in range(4)]
print(min(A,B) + min(C,D))
Problem p03447 (python)

Fixed submission:
X = int(input())
A = int(input())
B = int(input())
print((X - A) % B)

Buggy submission (verdict: Runtime Error):
A,B,C,X = [int(input()) for i in range(4)]
count = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500 * i + 100 * j + 50 * k == X:
                count += 1
print(count)
Problem p03448 (python)

Fixed submission:
A,B,C,X = [int(input()) for i in range(4)]
count = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500 * i + 100 * j + 50 * k == X:
                count += 1
print(count)

Buggy submission (verdict: Runtime Error):
A,B,C,X = [int(input()) for _ in range(4)]
count = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if i+j+k = X
            count += 1
print(count)

Buggy submission (verdict: Runtime Error):
A,B,C,X = [int(input()) for i in range(4)]
count = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(C + 1):
            if 500 * A + 100 * B + 50 * C == X:
                count += 1
print(count)
Problem p03477 (python)

Fixed submission:
A,B,C,D = map(int, input().split())
# A = int(input())
# B = int(input())
# C = int(input())
# X = input()
L = A + B
R = C + D
print("Left" if L > R else "Balanced" if L == R else "Right")

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())
# A = int(input())
# B = int(input())
# C = int(input())
# X = input()
L = A + B
R = C + D
print("Left" if L > R else "Balanced" if L = R else "Right")
Problem p03485 (python)

Fixed submission:
a,b = map(int, input().split())
import math
print(math.ceil((a + b) / 2))

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
import math
print(mith.ceil((a + b) / 2)
Problem p03502 (python)

Fixed submission:
N = input()
print("Yes" if int(N) % sum(map(int,N)) == 0 else "No")

Buggy submission (verdict: Runtime Error):
N = input()
print("Yes" if N % sum(map(int,N)) == 0 else "No")
Problem p03610 (python)

Fixed submission:
s = input()
print(s[::2])

Buggy submission (verdict: Runtime Error):
s = input()
print(s.[::2])

Buggy submission (verdict: Runtime Error):
s = input()
print(s.[1::2])

Buggy submission (verdict: Runtime Error):
s = input()
print(s.[::1])
Problem p03623 (python)

Fixed submission:
x,a,b = map(int,input().split())
if abs(a-x) > abs(b-x):
    print("B")
else:
    print("A")

Buggy submission (verdict: Runtime Error):
x,a,b = map(int,input())
if abs(a-x) > abs(b-x):
    print("B")
else:
    print("A")

Buggy submission (verdict: Runtime Error):
x,a,b = map(int,input())
if abs(a-x) > abs(b-x):
    print("A")
else:
    print("B")
Problem p03636 (python)

Fixed submission:
s = input()
S = len(s) - 2
print(s[0] + str(S) + s[-1])

Buggy submission (verdict: Runtime Error):
s = input()
S = len(s) - 2
print(s[0] + S + s[-1])
Problem p03644 (python)

Fixed submission:
N = int(input())
i = 1
while i <= N:
    i = i*2
print(i//2)

Buggy submission (verdict: Runtime Error):
N = int(input())
i = 1
while i <= N:
    i = i*2
peint(i//2)
Problem p02705 (python)

Fixed submission:
R = int(input())

print(R*6.2828)

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

for i in A:
    if A[i]<A[i+1]:
        print(A.count(i))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.insert(0,0)
             
print(A)

for i in A:
    print(A.count(i+1))
Problem p02705 (python)

Fixed submission:
import sys
import math
from collections import deque
input = lambda: sys.stdin.readline().rstrip()
Yes = lambda boolean: print('Yes') if boolean else print('No')
YES = lambda boolean: print('YES') if boolean else print('NO')
aint = lambda: int(input())
ints = lambda: list(map(int, input().split()))
is_even = lambda x: True if x%2==0 else False
zeros2d = lambda r,c: [[0 for col in range(c)] for row in range(r)]

R = aint()
print(2*R*math.pi)

Buggy submission (verdict: Runtime Error):
import sys
import math
from collections import deque
input = lambda: sys.stdin.readline().rstrip()
Yes = lambda boolean: print('Yes') if boolean else print('No')
YES = lambda boolean: print('YES') if boolean else print('NO')
aint = lambda: int(input())
ints = lambda: list(map(int, input().split()))
is_even = lambda x: True if x%2==0 else False
zeros2d = lambda r,c: [[0 for col in range(c)] for row in range(r)]

R = aint()
print(2*R*math.pi())

Buggy submission (verdict: Runtime Error):
import sys
import math
from collections import deque
input = lambda: sys.stdin.readline().rstrip()
Yes = lambda boolean: print('Yes') if boolean else print('No')
YES = lambda boolean: print('YES') if boolean else print('NO')
aint = lambda: int(input())
ints = lambda: list(map(int, input().split()))
is_even = lambda x: True if x%2==0 else False
zeros2d = lambda r,c: [[0 for col in range(c)] for row in range(r)]

R = aint()
print(2*R*math.pi())
Problem p02718 (python)

Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip()
yes = lambda boolean: print('Yes') if boolean else print('No')
input_ints = lambda: list(map(int, input().split()))
 
N, M = input_ints()
A = input_ints()
A.sort(reverse=1)
yes(A[M-1]*4*M>=sum(A))

Buggy submission (verdict: Runtime Error):
import sys
input = lambda: sys.stdin.readline().rstrip()
yes = lambda boolean: print('Yes') if boolean else print('No')
input_ints = lambda: list(map(int, input().split()))

N, M = input_ints()
A = input_ints()
A.sort(reverse=1)
yes(A[M-1]*4*M>_1)
Problem p02741 (python)

Fixed submission:
K = int(input())
L = [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(L[K-1])

Buggy submission (verdict: Runtime Error):
K = int(input().split())
L = [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(L[K-1])
Problem p03545 (python)

Fixed submission:
ABCD = input()
A, B, C, D = int(ABCD[0]), int(ABCD[1]), int(ABCD[2]), int(ABCD[3])
oper = ['+', '-']

for op1 in range(2):
    for op2 in range(2):
        for op3 in range(2):
            sum = A + (-1)**op1*B + (-1)**op2*C + (-1)**op3*D
            if sum == 7:
                ans = str(A)+oper[op1]+str(B)+oper[op2]+str(C)+oper[op3]+str(D)+'=7'
                break
print(ans)

Buggy submission (verdict: Runtime Error):
ABCD = input()
A, B, C, D = int(ABCD[0]), int(ABCD[1]), int(ABCD[2]), int(ABCD[3])
oper = ['+', '-']
for op1 in range(2):
    for op2 in range(2):
        for op3 in range(2):
            sum = A + (-1)**op1*B + (-1)**op2*C + (-1)**op3*D
            if sum == 7:
                return str(A)+oper[op1]+str(B)+oper[op2]+str(C)+oper[op3]+str(D)+'=7'
Problem p02684 (python)

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
count=0
lst={}
lst2=[]
now=1
c=0

while True:
    lst2.append(now)
    lst[now]=c
    now=a[now-1]
    if now in lst:
        break
    c+=1



amari=lst[now]
looplen=c-lst[now]+1


if k<=amari:
    print(lst2[k])

else:
    newlst=lst2[amari:]
    
    newk=k-amari
    num=newk%looplen
    print(newlst[num])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
count=0
lst=[]
now=1
for i in range(n):
    if now in lst:
        
        break
    lst.append(now)
    now=a[now-1]
ind=lst.index(now)

if k<=len(lst):
    print(lst[k])

else:
    newlst=lst[ind:]
    num=len(lst)-len(newlst)
    newk=k-num
    num2=newk%len(newlst)
    print(newlst[num2])
Problem p02696 (python)

Fixed submission:
a,b,n=map(int,input().split())
def ans(x):
    return int(a*x/b)
print(ans(min(n,b-1)))

Buggy submission (verdict: Runtime Error):
a,b,n=map(int,input().split())
'''
lst=[]
for i in range(n+1):
    now=int(a*i/b)-a*int(i/b)
    lst.append(now)
print(max(lst))
'''
lst=[]
if n>=b:
    ans=int(a*(n-1)/b)-a*int((n-1)/b)
    ans2=int(a*n/b)-a*int(n/b)

    print(max(ans,ans2,max(lst)))

else:
    ans=int(a*(n)/b)-a*int((n)/b)
    print(max(ans,0))
Problem p02714 (python)

Fixed submission:
from collections import*
n=int(input())
s=input()
c=0
r=s.count('R')
g=s.count('G')
b=s.count('B')
rgb=r*g*b

for i in range(n-2):
    for j in range(i+1,n-1):
        k=2*j-i 
        if k<n and s[k]!=s[i] and s[k]!=s[j] and s[i]!=s[j]:
            rgb-=1

print(rgb)

Buggy submission (verdict: Runtime Error):
from collections import*
n=int(input())
s=input()
c=0
r=s.count('R')
g=s.count('G')
b=s.count('B')
rgb=r*g*b

for i in range(n):
    for j in range(i+1,n):
        k=2*(j-i) 
        if k<=n and s[k]!=s[i] and s[k]!=s[j] and s[i]!=s[j]:
            rgb-=1

print(rgb)
Problem p02720 (python)

Fixed submission:
from collections import deque
k=int(input())
q=deque(range(1,10))
for i in range(k):
    x=q.popleft()
    if x%10!=0:
        q.append(10*x+x%10-1)
    q.append(10*x+x%10)
    if x%10!=9:
        q.append(10*x+x%10+1)
print(x)

Buggy submission (verdict: Runtime Error):
from queue import deque
k=input()
que=deque([i for i in range(1,10)])
for i in range(k):
    x=que.popleft()
    if x%10!=0:
        que.append(10*x+x%10-1)
    que.append(10*x+x%10)
    if que%10!=9:
        que.append(10*x+q%10+1)
print(x)

Buggy submission (verdict: Runtime Error):
from queue imort deque
k=input()
que=deque([i for i in range(1,10)])
for i in range(k):
    x=que.popleft()
    if x%10!=0:
        que.append(10*x+x%10-1)
    que.append(10*x+x%10)
    if que%10!=9:
        que.append(10*x+q%10+1)
print(x)
Problem p02742 (python)

Fixed submission:
h,k=map(int,input().split())
if h==1 or k ==1:
    print(1)
elif h*k%2==0:
    print(int((h*k)/2))
else:
    print(int((h*k)//2 + 1))

Buggy submission (verdict: Runtime Error):
h,k=map(int,input().split())
if h==1 or w ==1:
    print(1)
if h*k%2==0:
    print((h*k)/2)
else:
    print((h*k)//2 + 1)
Problem p03294 (python)

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

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans=0
if k%2==1:
    ans=(n//k)**3
    print(ans)
else:
    print((n//k)**3+(n+(k//2)//k)**3)
Problem p03378 (python)

Fixed submission:
n,m,x=map(int,input().split())
s=sum(int(i)<x for i in input().split())
print(min(s,m-s))

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split)
s=sum(int(i)<x for i in input().split())
print(min(s,m-s))

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split)
s=sum(int(i)<x for i in input().split())
print(min(s,m-s))
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 range(4))
print(min(a,b)+min(c,d))
Problem p03861 (python)

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

fb=b//x
fa=(a-1)//x
print(fb-fa)

Buggy submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
count=0
lst=[0]*(b+1)

for i in range(0,b+1):
    lst[i]=i//x
print(lst[b]-lst[a-1])
Problem p02843 (python)

Fixed submission:
M = [100,101,102,103,104,105]
X = int(input())

dp = [0 for i in range(X+1)]
dp[0] = 1

for i in range(X):
    if dp[i] == 1:
        for j in M:
            if i + j <= X:
                dp[i+j] = 1
print(dp[-1])

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
num = [100,101,102,103,104,105]
p = itertools.permutations(num, 5)



if X < 100:
    print(0)
else:
    ret = 0
    M = []
    for i in range(1, 6):
        c = itertools.combinations(num, i)
        for j in c:
            ret = sum(j)
            M.append(ret)

    ans = 0

    for i in num:
        if N % i == 0:
            ans = 1
            break
        if N % i in M:
            ans = 1
            break
        for j in M:
            if (N%i)%j == 0:
                ans = 1
        
        
    r = N
    for i in M:
        r = r - i
        if r in M:
            ans = 1
            break

    print(ans)