Problem:
 Score: 300 points    Problem Statement  AtCoder Mart sells 1000000 of each of the six items below:   Riceballs, priced at 100 yen (the currency of Japan) each  Sandwiches, priced at 101 yen each  Cookies, priced at 102 yen each  Cakes, priced at 103 yen each  Candies, priced at 104 yen each  Computers, priced at 105 yen each   Takahashi wants to buy some of them that cost exactly X yen in total.
Determine whether this is possible. (Ignore consumption tax.)      Constraints   1 \leq X \leq 100000  X is an integer.         Input  Input is given from Standard Input in the following format:  X       Output  If it is possible to buy some set of items that cost exactly X yen in total, print 1 ; otherwise, print 0 .        Sample Input 1 615      Sample Output 1 1  For example, we can buy one of each kind of item, which will cost 100+101+102+103+104+105=615 yen in total.       Sample Input 2 217      Sample Output 2 0  No set of items costs 217 yen in total.

Solution (Python):


import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    x = int(input())
    dp = [False] * (100000 + 1)
    dp[0] = True

    for p in [100,101,102,103,104,105]:
        for i in range(100000 + 1):
            if p <= i:
                dp[i] |= dp[i-p]

    print(1 if dp[x] else 0)


if __name__ == '__main__':
    main()

Solution (Python):
X = int(input())
for i in range(1,X+1) :
    for j in range(100*i,105*i+1) :
        if X % j == 0 :
            print(1)
            exit()
print(0)

Solution (Python):
X = int(input())  
product_amount = X // 100
hasuu = X % 100


if 5 * product_amount >= hasuu:
    print(1)
else:
    print(0)

Solution (Python):
from sys import stdin


def main():
    X = int(stdin.readline().rstrip())

    n = X//100
    under = X - n * 100

    if under > n*5:
        print(0)
    else:
        print(1)


if __name__ == "__main__":
    main()

Solution (Python):
t=[100,101,102,103,104,105]
N=int(input())
for i in t:
        if N%i==0:
                print(1)
                exit()
a,b = divmod(N,100)
c,d = divmod(b,5)
if a >= c+1:
        print(1)
else: print(0)

Solution (Python):


X = int(input())
q = X//100
mod = X%100

if q*5 >= mod: print(1)
else: print(0)

Solution (Python):
A = 1
for i in range(20):
    for j in range(100, 106):
        A = A | (A << j)
N = int(input())
print(1 if N >= 2000 else A >> N & 1)

Solution (Python):
A = 7175816845464090776455207507270117755723765735430536804658747273399161802972634276448409301356909248005606116656073561929444931323143190717332175076262060295351620527202705615498306139275508555689509950694997345595674093104433020700546656778950085095645658807229584194806623377338842753774743833376783450229118372573460572454731223569400078753907185233376010906274531347459925723690095854183385568140762360863180004465626012327328449425540345922055914421850333689171725134946657507151835356233535112180627200151906292121106447641907908790376379132422532166122413876168625333717615295123397246508335105
N = int(input())
print(1 if N >= 2000 else A>>N & 1)

Solution (Python):
import math
x = int(input())
c_min = math.ceil(x/105)
c_max = x/100
 
if c_min <= c_max:
  print(1)
else:
  print(0)

Solution (Python):
import sys

payable = [False] * (10 ** 5 + 1)
payable[0] = True
for i in range(100,106):
    payable[i] = True

for i in range(106, 10 ** 5 + 1):
    payable[i] = any(payable[i-105:i-99])

def main():
    x = int(sys.stdin.readline().rstrip())
    print(payable[x] & 1)

if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
if n >= 2000:
    print(1)
    quit()
x = n//100
if x*100 <= n <= x*105:
    print(1)
else:
    print(0)

Solution (Python):
import sys

def main():
    x = int(sys.stdin.readline().rstrip())

    payable = [False] * (x + 1)
    payable[0] = True

    if x < 100:
        print(0)
        sys.exit()
    if 100 <= x <= 105:
        print(1)
        sys.exit()

    for i in range(100,106):
        payable[i] = True
    for i in range(106, x+1):
        payable[i] =  any(payable[i-105:i-99])

    print(payable[x] & 1)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
import numpy as np
def main():
    x = int(sys.stdin.readline().rstrip())
    
    if x < 100:
        print(0)
        sys.exit()
    if 100 <= x <= 105:
        print(1)
        sys.exit()

    dp = np.zeros_like(np.arange(x+1), dtype=bool)
    dp[100:106] = True
    for i in range(106, x+1):
        dp[i] =  np.any(dp[i-105:i-99])

    print(dp[x] & 1)

if __name__ == '__main__':
    main()

Solution (Python):
coin = [100, 101, 102, 103, 104, 105]
X = int(input())
dp = [0]*(X+5)
dp[0]=1
for i in coin:
	for j in range(X+5):
		if i<=j:
			if dp[j-i]:
				dp[j]=1
print(1) if dp[X] else print(0)

Solution (Python):
x = int(input())

cnt = 0
for i in range(1000):
  if 100*i <= x <= 105*i:
    print(1)
    cnt = 1
    break
if cnt == 0:
  print(0)

Solution (Python):
import sys 

X = int(input())
if (X//100)*5 >= X%100:
  print(1)
else:
  print(0)

Solution (Python):
n=int(input())
a=n//100
b=n%100
print((int)(b<=a*5))

Solution (Python):
n = int(input())
y = n//100
print( 1 if 105*y>=n else 0 )

Solution (Python):
x=int(input())

dp = [False for _ in range(x+1)]
dp[0] = True 
for i in range(x+1):
    if i >= 100:
        dp[i] = dp[i] or dp[i-100]
    if i >= 101:
        dp[i] = dp[i] or dp[i-101]
    if i >= 102:
        dp[i] = dp[i] or dp[i-102]
    if i >= 103:
        dp[i] = dp[i] or dp[i-103]
    if i >= 104:
        dp[i] = dp[i] or dp[i-104]
    if i >= 105:
        dp[i] = dp[i] or dp[i-105]

if dp[x]:print(1)
else:print(0)

Solution (Python):
import math
x = int(input())
c = math.floor(x / 100)
if 100*c <= x <= 105*c:
    print(1)
else:
    print(0)

Solution (Python):
X = int(input())
if X >= 2000:
    print(1)
elif X<= 99:
    print(0)
else:
    c = 0
    for i in range(1,20):
        if int(X//100) == i:
            if X%100 <= i*5:
                c=1
    print(c)

Solution (Python):
X = input()

last2 = int(X[len(X)-2:])
try_num = int(X) //100

if try_num >= 20:
    print(1)
    exit(0)

for i in range(try_num):
    if last2 > 5:
        last2 -= 5
    else:
        print(1)
        exit(0)
print(0)

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) 

def LI(): return list(map(int, sys.stdin.readline().split()))
X = int(input())
prices = [100,101,102,103,104,105]

















dp = [0 for i in range(max(X + 1, 106))]
for price in prices:
    dp[price] = 1
for i in range(len(dp)):
    for price in prices:
        if i > price and dp[i - price] == 1:
            dp[i] = 1

print(dp[X])

Solution (Python):
n = int(input().strip())
valid = { 0: True }
for i in range(1, n+1):
  valid[i] = any(valid.get(i-j, False) for j in range(100, 106))
print (1 if valid[i] else 0)

Solution (Python):
import sys
input = sys.stdin.readline
def solve():
  x = int(input())
  ans = 0
  for i in range(1,20001):
    if 100*i <= x and x <= 105*i:
       ans = 1
  print(ans)
solve()

Solution (Python):
x = int(input())
y = x//100
if x%100<=y*5:
    print(1)
else:
    print(0)

Solution (Python):
num = int(input())

item_number = num//100
temp_val = num%100
times = temp_val //5

if temp_val % 5 != 0:
    times += 1




if item_number >=times:
    print(1)
else:
    print(0)

Solution (Python):
x = int(input())
dp = [0] * 100010
dp[100] = 1
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(106, 100010):
    if (
        dp[i - 100]
        or dp[i - 101]
        or dp[i - 102]
        or dp[i - 103]
        or dp[i - 104]
        or dp[i - 105]
    ):
        dp[i] = 1

print(1 if dp[x] else 0)

Solution (Python):
import itertools as it

num = int(input())

item_number = num//100
temp_val = num%100

times = temp_val //15
temp_val = temp_val % 15

if temp_val <= 5:
    temp_val = 1
elif temp_val <= 10:
    temp_val = 2
else:
    temp_val =3

need_item_number = 3*times + temp_val





if item_number >= need_item_number:
    print(1)
else:
    print(0)

Solution (Python):
x = int(input())
n = x // 100
res = x - 100 * n
if res > 5 * n:
    print(0)
else:
    print(1)

Solution (Python):
import itertools as it

num = int(input())

item_number = num//100

if item_number>= 20:
    item_number = 20

res_list = []
candi_list = list(it.combinations_with_replacement([100, 101, 102, 103, 104, 105], item_number))
candi_ans_list = [sum(item) for item in candi_list]

if num >= 2000:
    print(1)
else:

    if num in candi_ans_list:
        print(1)
    else:
        print(0)

Solution (Python):
import sys

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  

X = ri()
q, r = divmod(X, 100)
bool = True
if q * 5 < r:
    bool = False
print(1 if bool else 0)

Solution (Python):
n=int(input())
print(1 if n%100*21<=n else 0)

Solution (Python):
X=int(input())
a=X//100
print(0 if a*5<X-a*100 else 1)

Solution (Python):
s=int(input())
print(int((s%100+4)//5*100<=s))

Solution (Python):
X=int(input())
M=X//100
for i in range(M+1):
    j=X-(100*i)
    if 0<=j<=5*i:
        print(1)
        exit()
print(0)

Solution (Python):
X = int(input())
for c in range(X//100 + 1):
    if 100*c <= X and X <= 105*c:
        print(1)
        exit()

print(0)

Solution (Python):
n = int(input())
if n >= 2000: print(1)
elif n >= 100:
    if n <= (n // 100 * 100 + 5 * (n // 100)): print(1)
    else: print(0)
else: print(0)

Solution (Python):
X = int(input())

X_mod = X%100
X_count = X//100

count = 0
for i in reversed(range(1,6)):
  count += X_mod//i
  X_mod = X_mod%i

ans = 0
if count <= X_count:
  ans = 1
else:
  ans = 0

print(ans)

Solution (Python):
n = int(input())

out = 1

if n < 100:
  out = 0
for i in range(1,20):
  if i*105 < n < (i+1)*100:
    out = 0

print(out)

Solution (Python):
n=int(input());print(+(n%100*21<=n))

Solution (Python):
n=int(input());print(+(n//100*5>=n%100))

Solution (Python):
X = int(input())
result_list = [0]*100200
result_list[0] = 1
a = [i for i in range(100,106)]
for i in range(100001):
    if result_list[i] == 1:
        for j in a:
            result_list[i+j] = 1
print(result_list[X])

Solution (Python):
n=int(input());print(+(n//100*5>=n%100))

Solution (Python):
n=int(input())
try:print(+(n%100/(n//100)<=5))
except:print(+(n<1))

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

X = INT()

dp = [0] * (X+1)
dp[0] = 1
for i in range(X):
    for j in range(100, 106):
        if i+j > X:
            break
        dp[i+j] |= dp[i]
print(dp[X])

Solution (Python):
def c():
	X = int(input())
	can = [False]*(X+1)
	can[0] = True
	for i in range(X+1):
		for j in [100,101,102,103,104,105]:
			if j > i:
				break
			elif can[i-j]:
				can[i] = True
	print(int(can[X]))
c()

Solution (Python):
dp=[0 for i in range(100110)]
dp[0]=1
a=[i for i in range(100,106)]
for i in range(100000):
  if dp[i]==1:
    for j in a:
      dp[i+j]=1
print(dp[int(input())])

Solution (Python):
x = int(input())















i = x // 100

if 100*i <= x <= 105*i:
  print(1)
else:
  print(0)

Solution (Python):

import sys


def solve(X: int):
    for i in range(1000):
        if i*100 <= X <= i*105:
            print(1)
            return 
    
    print(0)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    solve(X)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
tmp=n//100
mod=n%100/5
if(mod<=tmp):
    print(1)
else:
    print(0)

Solution (Python):
X = int(input())

q = X // 100
mod = X % 100

if q >= (mod / 5):
 print(1)

else:
 print(0)

Solution (Python):
N = int(input())
dp = [0]*(100000+1)
dp[100] = 1
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1
for i in range(200, N+1):
    if dp[i-100]==1 or dp[i-101]==1 or dp[i-102]==1 or dp[i-103]==1 or dp[i-104]==1  or dp[i-105]==1:
        dp[i]=1
print(dp[N])

Solution (Python):
import math

x = int(input().strip())

sho = x//100
hasuu = x - 100*sho

if math.ceil(hasuu / 5) <= sho:
    print(1)
else:
    print(0)

Solution (Python):

import sys


def solve(X: int):
    dp = [False for _ in range(X+1)]
    dp[0] = True
    prices = [100,101,102,103,104,105]
    for i in range(1,X+1):
        for price in prices:
            if i >= price:
                if dp[i-price]:
                    dp[i] = dp[i-price]
                    break
    
    print(int(dp[X]))
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    solve(X)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())

for i in range(1, n+1):
    if 100*i <= n <= 105*i:
        print(1)
        exit()

print(0)

Solution (Python):
import sys
import math

n=int(input())
a=n%100
b=math.floor(n/100)+1
f=True
while b != 0:
  for i in range(b):
    for j in range(b-i):
      for k in range(b-i-j):
        for l in range(b-i-j-k):
          for m in range(b-i-j-k-l):
            if i+2*j+3*k+4*l+5*m == a:
              print(1)
              sys.exit()
  a+=100
  b-=1
print(0)

Solution (Python):
def count(S, m, n): 
    if n < 100:
        return 0

    table = [False for k in range(n+1)]   
    table[100:106] = [True] * 6

    for i in range(106, n+1):
        table[i] = any([table[i-j] for j in range(S[0], S[-1]+1)])
  
    return 1 if table[n] else 0
  
def main():
    X = int(input())
    S = [100, 101, 102, 103, 104, 105] 
    print(count(S, len(S), X))

if __name__ == "__main__":
    main()

Solution (Python):
X = int(input())
if X >= 100*101:
  print(1)
else:
  N1 = X//105
  N2 = X//100
  ans = 0
  for n in range(N1, N2 + 1):
    if (X >= 100*n)&(X <= 105*n):
      ans = 1
  print(ans)

Solution (Python):
def main():
    N = int(input())
    i = N//100
    if 100*i <= N <= 105*i:
        return print(1)
    else:
        return print(0)


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    N = int(input())
    for i in range(1, N+1):
        if 100*i <= N <= 105*i:
            return print(1)
    print(0)


if __name__ == '__main__':
    main()

Solution (Python):

import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


X = read_a_int()

for n in range(1000):
    if 100 * n <= X <= 105 * n:
        print(1)
        exit()
else:
    print(0)

Solution (Python):

import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


X = read_a_int()

for n in range(1000):
    if 100 * n <= X <= 105 * n:
        print(1)
        exit()
else:
    print(0)

Solution (Python):
X = int(input())
c = X//100
r = X%100
print(1 if 0 <= r <= c*5 else 0)

Solution (Python):
def solve():
    x = int(input())

    min_ = x // 105
    max_ = x // 100

    for c in range(max_, max_ + 1):
        if 100 * c <= x <= 105 * c:
            return 1
    return 0


print(solve())

Solution (Python):
import math
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**9)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

x = INT()

for i in range(1,10**6+1):
    if i*100<=x<=i*105:
        print(1)
        exit()
print(0)

Solution (Python):
n=int(input())
a=n//100
b=n%100
if 0<=b<=5*a:
  print(1)
else:
  print(0)

Solution (Python):
X = int(input())
items = list(range(100, 106))
dp = [0 for _ in range(0, X+1)]
dp[0] = 1

for i in range(0, len(dp)):
  for j in items:
    if i+j <= len(dp)-1 and dp[i] > 0:
      dp[i+j] += 1
      if i+j == X:
        print('1')
        exit()

print('0')

Solution (Python):
X = int(input())

item_value = [100, 101, 102, 103, 104, 105]
dp = [0] * (100001)
for value in item_value:
    dp[value] = 1

for i in range(200, X + 1):
    for value in item_value:
        if dp[i - value] == 1:
            dp[i] = 1

print(dp[X])

Solution (Python):


import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

X = I()

for i in range(X):
    if i * 100 <= X and X <= i * 105:
        print(1)
        break
else:
    print(0)

Solution (Python):
x = int(input())

n = x // 100
f = 0

for j in range(n+1):
    if j*100 <= x <= j*105:
        f = 1

if f:
    print(1)
else:
    print(0)

Solution (Python):
X = int(input())
n = X // 100

if 100*n <= X <= 105*n:
  print(1)
else:
  print(0)

Solution (Python):
import collections
import itertools as it
import math
import numpy as np









X = int(input())
nshohin = X // 100
amari = X % 100

print(0 if nshohin * 5 < amari else 1)

Solution (Python):
x = int(input())

n = x // 100
if n*100 <= x <= n*105:
  print('1')
else:
  print('0')

Solution (Python):
import sys
from decimal import Decimal, ROUND_HALF_UP
import math
input = sys.stdin.readline


def main():
    """code here"""
    x=int(input())
    dp = [0]*(x+1)
    dp[0]=1
    for i in range(x+1):
        if dp[i]:
            for tmp in [100,101,102,103,104,105]:
                if i+tmp<=x:
                    dp[i+tmp]=1
    print(dp[-1])




if __name__ == '__main__':
    main()

Solution (Python):
def main():

    X = int(input())
    n1 = X // 105
    n2 = X // 100

    for j in range(n1, n2+1):
        v = X - 100 * j
        if 0 <= v <= 5*j:
            return '1'
    return '0' 

if __name__ == '__main__':
    print(main())

Solution (Python):
from functools import lru_cache
import sys
sys.setrecursionlimit(100000000)
money = [0,1,2,3,4,5]
n = int(input())
p = 0
lm = n//100
need = n - (lm*100)
@lru_cache(None)
def dfs( cur,limit):
    global p,need
    if not p:
        for i in range(6):
            now = cur+money[i]
            if limit+1 == lm:
                if now == need:
                    p =1
                    break
            elif limit+1<=lm:
                dfs(now,limit+1)
if n>=100:
    dfs(0,0)
    print(1 if p else 0)
else:
    print(0)

Solution (Python):
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])

Solution (Python):
n=int(input())
boo=[0 for i in range(10**5+1000)]
boo[100]=1
boo[101]=1
boo[102]=1
boo[103]=1
boo[104]=1
boo[105]=1
for i in range(100,n+1):
  if boo[i]==1:
    for j in range(6):
      boo[i+100+j]=1
if boo[n]:
  print(1)
else:
  print(0)

Solution (Python):
x = int(input())
d = (x%100)//5
if x%5 != 0:
    d += 1
m = d * 100 + x%100
print(1 if m<=x else 0)

Solution (Python):
X = int(input())

dp = [0] * 100001
dp[0] = 1
dp[100] = 1
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(106,X+1):
    dp[i] = dp[i-100] + dp[i-101] + dp[i-102] + dp[i-103] + dp[i-104] + dp[i-105]
    if dp[i] != 0:
        dp[i] = 1

print(dp[X])

Solution (Python):
X = int(input())

num_list = [0]*(100001 + 105)
num_list[0] = 1

for i in range(100001 + 105):
    if i == X:
        print(num_list[X])
        exit()

    for j in [100, 101, 102, 103, 104, 105]:
        if num_list[i]:
            num_list[i+j] = 1

print(0)

Solution (Python):
X = int(input())

ans = 0
while True:
  if X >= 100:
    k = X % 100
    if k <= 5:
      ans = 1
      break
    else:
      X -= 105
  else:
    break

print(ans)

Solution (Python):
ans = 0
N = int(input())
for i in range(10000):
    a = 100 * i 
    b = 105 * i
    if(a <= N <= b):
        ans =1
print(ans)

Solution (Python):
n=int(input())
x=1
while x<n//100+1:
  if 100*x<=n and n<=105*x:
    print(1)
    exit()
  x+=1
print(0)

Solution (Python):
import sys
X=int(input())
for c in range(X):
    if (100*c<=X) and (105*c>=X):
        print(1)
        sys.exit()
print(0)

Solution (Python):
x = int(input())

quot = x//100
rem = x%100

if rem <= quot*5:
    print(1)
else:
    print(0)

Solution (Python):
from pprint import pprint
import sys

def solve(n):
    for i in range(n // 100 + 1):
        if 100 * i <= n <= 105 * i:
            print(1)
            return
    
    print(0)
    

if __name__ == "__main__":
    n = int(sys.stdin.readline().strip())
    solve(n)

Solution (Python):
x = int(input())

n = x%100

q,r=divmod(n,5)

if r:
  q+=1

if x//100 >= q:
  print(1)
else:
  print(0)

Solution (Python):
X=int(input())

def func(i):
    global n
    global hoge
    n-=int(hoge/i)
    hoge=hoge%i

n=int(X/100)
hoge=X%100

for i in [5,4,3,2,1]:
    func(i)
if n<0:
    print(0)
else:
    print(1)

Solution (Python):
def c_100_to_105():
    X = int(input())

    if 1 <= X <= 99:
        return '0'
    if 100 <= X <= 105:
        return '1'
    can_pay = [False] * (X + 1)  
    for i in range(100, 106):
        can_pay[i] = True
    for i in range(106, X + 1):
        for j in range(100, 106):
            if i - j >= 0 and can_pay[i - j]:
                can_pay[i] = True
                break
        else:
            can_pay[i] = False
    return '1' if can_pay[X] else '0'

print(c_100_to_105())

Solution (Python):
x = int(input())
l = int(x/105)
u = int(x/100)+1
flag = False
for n in range(l, u):
    for a in range(0, u):
        for b in range(0, u-a):
            for c in range(0, u-a-b):
                for d in range(0, u-a-b-c):
                    for e in range(0, u-a-b-c-d):
                        for f in range(0, u-a-b-c-d-e):
                            if 100*a + 101*b + 102*c + 103*d + 104*e + 105*f == x:
                                
                                flag = True
                                break
                            if flag == True: break
                        if flag == True: break
                    if flag == True: break
                if flag == True: break
            if flag == True: break
        if flag == True: break
    if flag == True: break

if flag:
    print('1')
else:
    print('0')

Solution (Python):
list = [100,101,102,103,104,105]


N = int(input())

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

for i in range(N):
    if dp[i] == 1:
        for j in range(len(list)):
            if i + list[j] <= len(dp)-1:
                
                dp[i+list[j]]=1


print(dp[-1])

Solution (Python):
from functools import reduce
from operator import add
X = int(input())
if X <= 105:
  if X<100:  print(0)
  else: print(1)
else:
  dp = [1] + [0]*X
  dp[100] = dp[101] = dp[102] = dp[103] = dp[104] = dp[105] = 1
  for i in range(106,X+1): dp[i] = min(reduce(add, [dp[i-(100+j)] for j in range(6)]),1)
  print(dp[-1])

Solution (Python):
x=int(input())
ans=0
if x>=2000:
    print(1)
else:
    for a in range(20):
        for b in range(20):
            for c in range(20):
                for d in range(20):
                    for e in range(20):
                        for f in range(20):
                            if 100*a+101*b+102*c+103*d+104*e+105*f==x:
                                ans=1
    print(ans)

Solution (Python):
X = int(input())

if X <= 99:
  print("0")
else:
  keta = X % 100  
  mai = keta // 5
  betu_mai = keta - mai * 5
  if betu_mai == 0:
    min = 105 * mai
  else:
    min = 105 * mai + int(str("10" + str(betu_mai)))
  
  if X >= min:
    print("1")
  else:
    print("0")

Solution (Python):
x=int(input())
n=x//100
if x<100:
    print('0')
else:
    if 100*n<=x and 105*n>=x:
        print('1')
    else:
        print('0')

Solution (Python):


x = int(input().rstrip())
c = 0

while True:
    if 100*c <= x <= 105*c:
        print(1)
        exit()
    if 100*c > x:
        break
    c += 1
print(0)

Solution (Python):
x=int(input())
n=x//100
if x<100:
    print('0')
else:
    if 100*n<=x and 105*n>=x:
        print('1')
    else:
        print('0')

Solution (Python):
x = input()
x = int(x)

kosu = x // 100

if kosu * 100 <= x <= kosu * 105:
    print(1)
else:
    print(0)

Solution (Python):
X = int(input())
C = X // 100
print(int(100 * C <= X <=105 * C))

Solution (Python):
X=int(input())
for i in range(1001):
    if X>=100*i and X<=105*i:
        print(1)
        break
else:
    print(0)

Solution (Python):
X = int(input())

def test(x):
    low = 100 * x
    high = 105 * x
    return low <= X <= high

bl = any([test(x) for x in range(X)])

print(bl*1)

Solution (Python):
x = int(input())
for i in range(1,x//100+2):
  if 100*i <= x <= 105*i:
    print(1)
    break
else:
  print(0)

Solution (Python):
import math

def main():
  X = int(input())
  count = math.floor(X / 100)
  if ((X >= 100 * count) and (X <= 105 * count)):
    print(1)
  else:
    print(0)

main()

Solution (Python):
x = int(input())
n = x // 100
can_buy = 0
while n > 0:
    if 100 * n <= x <= 105 * n:
        can_buy = 1
        break
    else:
        n -= 1
print(can_buy)

Solution (Python):
x = int(input())
s = x // 100
amari = x % 100
if amari <= s * 5:
    print('1')
else:
    print(0)

Solution (Python):
X = int(input())

for n_buy in range(X//105, X//100+1):
    if n_buy * 100 <= X <= n_buy * 105:
        print(1)
        exit()
print(0)

Solution (Python):

X = int(input())

a = X % 100
b = X// 100
count = 0
if a == 0:
    print(1)
elif a % 5 == 0:
    if b >= a/5:
        print(1)
    else:
        print(0)
        
else:
    x = a // 5 + 1
    if b >= x:
        print(1)
    else:
        print(0)

Solution (Python):
import math

def read():
    X = int(input().strip())
    return X,


def solve(X):
    if X >= 2000:
        return 1
    A = [100 ,101, 102, 103, 104, 105]
    NA = 6
    dp = [[False for j in range(X+1)] for i in range(NA+1)]
    for i in range(NA+1):
        dp[i][0] = True
    for i in range(NA):
        for x in range(0, X+1):
            j = 0
            while x - j * A[i] >= 0:
                if dp[i][x - j * A[i]]:
                    dp[i+1][x] = True
                j += 1
    return 1 if dp[NA][X] else 0
    
if __name__ == '__main__':
    inputs = read()
    output = solve(*inputs)
    print("%d" % output)

Solution (Python):
x = int(input())
cnt = x // 100
y = x - 100 * cnt

if cnt * 5 >= y:
    print(1)
else:
    print(0)

Solution (Python):

X = int(input())

for a in range(2501):
    for b in range(2501-100*a):
        for c in range(2501-100*a-101*b):
            for d in range(2501-100*a-101*b-102*c):
                for e in range(2501-100*a-101*b-102*c-103*d):
                    for f in range(2501-100*a-101*b-102*c*103*d-104*e):
                        if 100*a+101*b+102*c+103*d+104*e+105*f == X:
                            print(1)
                            exit()
                        else:
                            pass
print(0)

Solution (Python):
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
'''
def GI(V,E,DAG=False,index=0):
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[1:])
            bb=(inp[1:])
        g[a].append(b)
        if g[b].append(a)
        h.append(b)
'''

def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()
 
show_flg=False
show_flg=True



n=I()

dp=[0]*(1+n)
dp[100:106]=[1]*6
for i in range(1+n):
    for j in range(100,106):
        if i-j>=0:
            dp[i]=max(dp[i],dp[i-j])
print(dp[n])

Solution (Python):
x = int(input())

ans = 0
for i in range(1,100001):
  if 100 * i <= x and 105 * i >= x:
    ans = 1
    break

print(ans)