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.



Sample input:
615


Sample output:
1

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(X):
    for i in range(1, 1000000+1):
        if 100 * i <= X <= 105* i:
            return 1
    return 0


def main():
    X = read_int()
    print(slv(X))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#coding:utf-8
from collections import deque
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = True

def index(a,b):
    return str(min(a,b)) + "," +  str(max(a, b))

def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]


    x = II()
    y = x // 100
    if y*100 <= x <= y*100+y*5 or x >= 2000:
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())

dp = [0] * (x + 1)
cost = [100, 101, 102, 103, 104, 105]

if x < 100:
    print('0')
elif x <= 105:
    print('1')
else:
    dp[0] = 1
    for _x in range(1, x + 1):
        for c in cost:
            if dp[_x - c] == 1:
                dp[_x] = 1
                continue

    if dp[-1]:
        print('1')
    else:
        print('0')

Submission status: Accepted

Solution code:
def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def f(num, s):
    if s > num * 5:
        return False

    return True


def main():
    X = int(input())
    num = X // 100
    while True:
        s = X - num * 100
        if f(num, s):
            print(1)
            return
        elif s > num * 5:
            print(0)
            return
        num -= 1


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys; readline = sys.stdin.readline
from collections import deque

X = int(readline())

q = X // 100
r = X % 100

if r > 5 * q:
    print('0')
else:
    print('1')

Submission status: Accepted

Solution code:
X = int(input())

mn = X // 105
mx = (X + 99) // 100
ans = 0
for i in range(mn, mx+1, 1):
    if X >= i * 100 and X <= i * 105:
        ans = 1
        break

print(ans)

Submission status: Accepted

Solution code:
x = int(input())
for y in range(x // 100 + 2):
    t = x - y * 100
    if 0 <= t <= 5 * y:
        print('1')
        break
else:
    print(0)

Submission status: Accepted

Solution code:
N = int(input())
if N >= 2000:
    print(1)
else:
    x = N // 100
    if 100*x <= N <= 105*x:
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
X = int(input())
items = [100, 101, 102, 103, 104, 105]
lrs = []
for i in range(1,100001):
    l = 100 * i
    r = 105 * i
    lrs.append([l, r])
idx = X // 100
if idx == 0:
    print(0)
    exit()
l, r = lrs[idx - 1]
if X <= r:
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
start = int(X/105) -1
end = int(X/100) + 1
flag=0
for i in range(start,end):
    residual = X - i*100
    if residual >=0 and residual <= 5*i:
        flag=1
        break
print(flag)

Submission status: Accepted

Solution code:
x = int(input())
q = x//100
r = x%100
if r <= q*5:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x = int(input())

r = x % 100

p = (x - r) // 100

if r <= 5 * p:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())
y = X//100
res = X-y*100
if res>y*5:
  print(0)
else:
  print(1)

Submission status: Accepted

Solution code:
N=int(input())


count=int(N/100)
mod=N%100
if(count*5<mod):
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
x = int(input())

if x>=2000:
    ans = 1
elif x<=99:
    ans = 0
else:
    check = x//100
    check2 = x%100
    if check*5>=check2:
        ans = 1
    else:
        ans = 0
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

if X % 100 > n*5:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
x=int(input())
p=x//100
q=x%100
if q<=5*p:
    ans=1
else:
    ans=0
print(ans)

Submission status: Accepted

Solution code:
def examC():
    X = I()
    p,q = divmod(X,100)
    if q>p*5:
        ans = 0
    else:
        ans = 1
    print(ans)
    return

def examD():
    return
def examE():
    return

def examF():
    return

import sys,copy,bisect,itertools,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examC()

Submission status: Accepted

Solution code:
x = int(input())
if x < 100:
    print(0)
    exit()

i = 0
while 105 * i + 1 < 100 * (i + 1):
    if 105 * i + 1 <= x < 100 * (i + 1):
        print(0)
        exit()
    i += 1
print(1)

Submission status: Accepted

Solution code:
X = int(input())

if X >= 2000:
  print("1")
  quit()
else:
  D = X // 100
  if X % 100 == 0:
    print("1")
    quit()
  elif X % 100 <= D * 5:
    print("1")
  else:
    print("0")

Submission status: Accepted

Solution code:
#%%
x = input()

if len(x) <= 2:
	ans = 0
elif int(x) >= 2000:
	ans = 1
else:
	if len(x) == 3:
		a = x[0]
		b = x[1:]
	else:
		a = x[0:2]
		b = x[2:]
	a = int(''.join(a))
	b = int(''.join(b))
	if a*5 >= b:
		ans = 1
	else:
		ans = 0
print(ans)

Submission status: Accepted

Solution code:
has = int(input())
dp = [False] * (has + 1)
dp[0] = True
for i in range(100, has + 1):
    for p in range(100, 106):
        if i - p >= 0:
            dp[i] |= dp[i - p]
print(1 if dp[has] else 0)

Submission status: Accepted

Solution code:
import sys
import math
from itertools import permutations
from itertools import combinations

#input = sys.stdin.readline
X = int(input())

cn = X//100
resi = X%100


if resi <= (cn*5):
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x=int(input())
print(int(any(100*i<=x<=100*i+5*i for i in range(1,x//100+1))))

Submission status: Accepted

Solution code:
X = int(input())

ok = [False for _ in range(100000 + 1)]
ok[0] = True

target = [100, 101, 102, 103, 104, 105]

for x in target:
    for i in range(100000 + 1 - x):
        ok[i + x] |= ok[i]

print(1 if ok[X] else 0)

Submission status: Accepted

Solution code:
x = int(input())
d, m = divmod(x, 100)
print(1 if 5 * d >= m else 0)

Submission status: Accepted

Solution code:
x = int(input())
dp = [False for _ in range(x + 1)]
dp[0] = True
for item in [100, 101, 102, 103, 104, 105]:
    for i in range(x + 1):
        if i - item >= 0:
            if dp[i - item]:
                dp[i] = True

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

Submission status: Accepted

Solution code:
x=int(input())
lst=[100,101,102,103,104,105]
dp=[0]*(x+1)
dp[0]=1
for u in lst:
    h=dp[:]
    for i in range(u,x+1):
        if dp[i-u]==1 or h[i-u]==1:
            h[i]=1
    dp=h
if dp[x]==1:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())
dp = [0]*(X+1)
dp[0]=1

for p in range(100,106):
    for i in range(p, X+1):
        dp[i] |= dp[i-p]
print(dp[X])

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


# rstrip().decode('utf-8')
# INF=float("inf")
#MOD=10**9+7
# sys.setrecursionlimit(2147483647)
# import math
#import numpy as np
# import operator
#import bisect
# from heapq import heapify,heappop,heappush
#from math import gcd
# from fractions import gcd
#from collections import deque
#from collections import defaultdict
# from collections import Counter
#from itertools import accumulate
# from itertools import groupby
# from itertools import permutations
# from itertools import combinations
# from scipy.sparse import csr_matrix
# from scipy.sparse.csgraph import floyd_warshall
# from scipy.sparse.csgraph import csgraph_from_dense
# from scipy.sparse.csgraph import dijkstra
# map(int,input().split())


def main():
	x=int(input())
	ans=0
	
	if x>=2000:
		ans=1
	else:
		a=x//100
		b=x-a*100
		if 5*a>=b:
			ans=1
	
	print(ans)
	
	
	
	
	
	
if __name__ == "__main__":
		main()

Submission status: Accepted

Solution code:
X = int(input())
a = X//100
if a*100 <= X <= a*105:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
n=int(input())
res=int((n%100)/5)
n -= 105*res
if n == 0 or n >= 100:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
if n % 100 == 0:
    print(1)
    exit()

while n > 100:
    n -= 100
    cnt += 1
    if n <= cnt * 5:
        print(1)
        exit()
print(0)

Submission status: Accepted

Solution code:
x = int(input())
r = x % 100
for i in range(5, 0, -1):
    while r >= i:
        r -= i
        x -= 100
    if x < 0:
        print(0)
        exit(0)
    if r == 0:
        print(1)
        exit(0)

Submission status: Accepted

Solution code:
X = int(input())
N = X // 100
if N * 5 >= X - N * 100:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

COINS = [100, 101, 102, 103, 104, 105]


def find_combinations(x, coins=COINS):
    dp = [int(i % coins[0] == 0) for i in range(x + 1)]
    for coin in coins[1:]:
        for i in range(coin, x + 1):
            dp[i] += dp[i - coin]
    return dp[x] > 0


def main():
    x = int(input())
    res = find_combinations(x)
    if res:
        print(1)
    else:
        print(0)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
def main():
    x = int(sys.stdin.readline().rstrip())
    q, r = divmod(x, 100)
    if r <= 5 * q:
        ans = 1
    else:
        ans = 0
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x=int(input())
a=x%100
b=x//100
c=a//5
c+=(a%5!=0)
print(int(b>=c))

Submission status: Accepted

Solution code:
x=int(input())
lists=[0 for i in range(100010)]
lists[100]=1
lists[101]=1
lists[102]=1
lists[103]=1
lists[104]=1
lists[105]=1
for i in range(106,100001):
    if lists[i-105]==1 or lists[i-104]==1 or lists[i-103]==1 or lists[i-102]==1 or lists[i-101]==1 or lists[i-100]==1:
        lists[i]=1
    else:
        pass
print(lists[x])

Submission status: Accepted

Solution code:
X = int(input())

if X < 100:
    print(0)
    exit()

max_num = X // 100

num_frac = X % 100

if num_frac <= max_num * 5:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x=int(input())
n=x//100
chk=False
for i in range(1,n+1):
  if x-(i*100)<=5*i:
    chk=True
print(1 if chk else 0)

Submission status: Accepted

Solution code:
X = int(input())
a,b = X//100, X%100
ans = 0
if b <= 5*a:
    ans = 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

two = x % 100

q, r = divmod(two, 5)

if r:
    q += 1

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

Submission status: Accepted

Solution code:
x = int(input())
print(int(x // 100 * 5 >= x % 100))

Submission status: Accepted

Solution code:
X = int(input())
dp = [0]*(X+1+110)
dp[0] = 1
for i in range(1, X+1):
    if any(dp[i-j] == 1 for j in range(100, 106)):
        dp[i] = 1
print(dp[X])

Submission status: Accepted

Solution code:
X = int(input())
Xdiv100 = X // 100
if Xdiv100 == 0:
    print(0)
elif Xdiv100 < 20:
    if Xdiv100 * 5 < X % 100:
        print(0)
    else:
        print(1)
else:
    print(1)

Submission status: Accepted

Solution code:
X = int(input())
x, y = X//100, X%100

z = 0
for i in range(5, 0, -1):
    z += y // i
    y %= i

if z <= x:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
def main():
    # input
    x = int(input())

    num = x//100
    a = x%100

    if a <= num*5:
        print(1)
    else:
        print(0)


    # calc


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x=int(input())
num=x//100
if x-num*100<=5*num:print(1)
else:print(0)

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
inf=float("inf")
x=int(input())
maxkosuu=x//100
amari=x%100
if amari<=maxkosuu*5:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
def p_c():
    x = int(input())
    n = x // 100
    if x - (n * 100) <= 5 * n:
        print(1)
    else:
        print(0)
        
p_c()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
dp = [0] * (N + 1)
dp[0] = 1
for i in range(N):
  for j in range(6):
    if i + j + 100 <= N:
      dp[i + j + 100] += dp[i]
if dp[-1]: print(1)
else: print(0)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
x = int(input())
dp = [False] * (x + 1)
dp[0] = True
for delta in range(100, 105 + 1):
    for y in range(len(dp) - delta):
        if dp[y]:
            dp[y + delta] = True
print(int(dp[x]))

Submission status: Accepted

Solution code:
#!/usr/bin/python3

import os
import sys


def main():
    X = read_int()
    print('1' if solve(X) else '0')


def solve(X):
    c = X // 100
    for d in range(6):
        n = c - d
        if n < 0:
            break
        r = X - 100 * n
        if 0 <= r <= n * 5:
            return True
    return False


###############################################################################

DEBUG = 'DEBUG' in os.environ


def inp():
    return sys.stdin.readline().rstrip()


def read_int():
    return int(inp())


def read_ints():
    return [int(e) for e in inp().split()]


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A = [0]*100201
A[0] = 1

for i in range(100000):
    if A[i]:
        A[i+100] = 1
        A[i+101] = 1
        A[i+102] = 1
        A[i+103] = 1
        A[i+104] = 1
        A[i+105] = 1

print(A[int(input())])

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = onem()

co = 0
cco = 0

for i in range(1,1000):
    co += 105
    cco += 1
    if n <= co:
        break

kkk = co - n

if kkk == 0:
    print(1)
else:
    if kkk <= cco * 5:
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
a=int(input())
b=a//100
c=a%100
if c/5<=b:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
X = int(input())
n = X / 100
y = X % 100

if y % 5 == 0:
    m = y // 5
else:
    m = y//5 + 1

if m <= n:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())
tmp = [0]*(10**5+107)
tmp[0] = 1
S = [i for i in range(100, 106)]
for i in range(10**5+1):
    for j in S:
        tmp[i+j] = tmp[i]+tmp[i+j]
if tmp[X] > 0:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x = int(input())

if x >= 2000:
  print(1)

else:
  q = x // 100
  r = x % 100
  if r <= 5 * q:
    print(1)
  else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())

for i in range(100000): #i個買うとする
    if 0 <= X - i * 100 <= 5 * i:
        print (1)
        exit()

print (0)

Submission status: Accepted

Solution code:
X = int(input())
tmp = X//100
lis = list(range(tmp*100,tmp*100+5*tmp+1))
if X in lis:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())
r100 = X%100
n = r100//5
if r100%5!=0:
    n += 1
if n <= X//100:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
def solve(x):
    y = x % 100
    ny = y // 5
    if y % 5 != 0:
        ny += 1
    if x // 100 >= ny:
        return 1
    else:
        return 0


def main():
    x = int(input())
    res = solve(x)
    print(res)


def test():
    assert solve(615) == 1
    assert solve(217) == 0


if __name__ == "__main__":
    test()
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
a=x//100
if a*100<=x<=a*100+(a*5):
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
n = int(input())
q, r = divmod(n, 100)
c = 0
for i in range(5, 0, -1):
  a, b = divmod(r, i)
  c += a
  r = b
if q >= c:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
Ans = [False] * 100001
Ans[0] = True
for i in range(1, 100001):
    for v in range(100, 106):
        Ans[i] |= Ans[i-v]
print(int(Ans[int(input())]))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline 

x = int(input())
#s = input()
#a = [int(i) for i in readline().split()]
#m = [[int(i) for i in readline().split()] for _ in range(n)]



if x >= 10000: print(1)
else:
    q = x//100
    r = x%100
    
    c = r//5
    if r%5: c += 1
    
    if q >= c:
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
import math


def main():
    n = int(input())
    dp = [0] * (n + 1)
    dp[0] = 1
    for i in range(1, n + 1):
        for j in range(100, 106):
            if i - j >= 0:
                dp[i] = dp[i] | dp[i-j]
    print(dp[n])

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
X = int(input())
N = X//100
m = X%100
if (m+4)//5 <=N:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x = int(input())
start = 100
end = 100000
flag = False
for i in range(1, int(end / start) + 1):
    if start <= x <= start + i * 5:
        flag = True
        break
    else:
        start += 100

print("1" if flag else "0")

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a = (n-n%100)//100
    b = n%100
    if 5*a >= b:
        print("1")
    else:
        print("0")
        
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

x = ni()
can = False
for i in range(1, x + 1):
    if 0 <= x - 100*i <= 5*i:
        can = True
        break
    if x - 100*i < 0:
        break
print('1' if can else '0')

Submission status: Accepted

Solution code:
X = int(input())

ans = 0
if(X < 100): ans = 0
else:
 count = X//100
 res = X - count*100
 if(0<= res <= 5*count):
   ans = 1
print(ans)

Submission status: Accepted

Solution code:
X = int(input())

dp = [0] * (X+1)
dp[0] = 1
for i in range(1, X+1):
    for j in range(100, 105+1):
        if i >= j and dp[i-j]:
            dp[i] = 1
print(dp[X])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def fi(): return float(input())
def mfi(): return map(float, input().rstrip().split())
def lmfi(): return list(map(float, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()
# template


def main():
    X = ii()
    n = X // 100
    for i in range(n, 0, -1):
        if(X - 100 * i < 0):
            break
        if(5 * i < X - 100 * i):
            continue
        else:
            exit(1)
    print(0)

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    x=int(input())
    a=x//100
    b=x%100
    b=(b-1)//5+1
    if b>a:
        print(0)
    else:
        print(1)
main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect, string, copy
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7
ans = count = 0; pro = 1


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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#solve
def solve():
    x = II()
    dp = [0] * (x + 1)
    dp[0] = 1
    for i in range(6):
        a = 100 + i
        for i in range(a, x + 1):
            dp[i] |= dp[i - a]
    print(dp[-1])
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000000)
from itertools import count
from functools import lru_cache
from collections import defaultdict
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok
#


def main():
    X = ii()
    @lru_cache(maxsize=None)
    def rec(n):
        if n == 0:
            return True
        elif n < 0:
            return False
        else:
            return any(rec(n-i) for i in range(100, 105+1))
    
    print(int(rec(X)))




main()

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    M = int(1e5+1)
    dp = [False] * M
    dp[0] = True
    for i in range(M):
        for j in range(100, 106):
            if i - j >= 0:
                dp[i] |= dp[i-j]
    if dp[X]:
        print(1)
    else:
        print(0)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
X=int(input())
if X>=2000:
  print(1)
else:
  r=X%100
  q=X//100
  if r>q*5:
    print(0)
  else:
    print(1)

Submission status: Accepted

Solution code:
import sys
x = int(input())
for i in range(1000):
    if 100*i <= x <= 105*i:
        print(1)
        sys.exit()
print(0)

Submission status: Accepted

Solution code:
X = int(input())

C = [0 for _ in range(X + 1)]
C[0] = 1
cost = [100, 101, 102, 103, 104, 105]

for x in range(X):
    for c in cost:
        if x + c > X:
            continue
        C[x + c] += C[x]

print(1 if C[X] != 0 else 0)

Submission status: Accepted

Solution code:
n = int(input())
if n >= 2000:
  print(1)
else:
  m = n//100
  l = n%100
  if l <= m*5:
    print(1)
  else:
    print(0)

Submission status: Accepted

Solution code:
import math

def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

# n 
# a, b = list(map(int, input().split()))
# s = input()


X = int(input())

a = X // 100
b = X % 100
if X < 100:
    print(0)
elif b <= a * 5:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
#設定
import sys
input = sys.stdin.buffer.readline

#ライブラリインポート
from collections import defaultdict

#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	X = int(input())
	DP = [0] * 100200
	DP[0] = 1
	for i in range(100001):
		if DP[i] == 1:
			DP[i + 100] = 1
			DP[i + 101] = 1
			DP[i + 102] = 1
			DP[i + 103] = 1
			DP[i + 104] = 1
			DP[i + 105] = 1

	if DP[X] == 1:
		print(1)
	else:
		print(0)

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
X = int(input())

Y = X // 100

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

Submission status: Accepted

Solution code:
x = int(input())
num = x//100
target = x%100
if num*5 >= target:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x = int(input())


for k in range(1001):
    a = x
    a -= 100 * k
    if 0 <= a and a <= 5*k:
        print('1')
        exit()

print('0')

Submission status: Accepted

Solution code:
#C
X = int(input())
x = X%100
N = X//100

if x <= N*5:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

dp = [False for _ in range(100001)]
def main():
    x = ri()
    lp = [100, 101, 102, 103, 104, 105]
    dp[0] = True
    for p in lp:
        for i in range(x+1):
            if not dp[i]:
                continue
            if i+p > x:
                continue
            dp[i+p] = True
    if dp[x]:
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    dp = [False] * (X + 1)
    dp[0] = True
    for i in range(X + 1):
        if dp[i]:
            for x in [100, 101, 102, 103, 104, 105]:
                if i + x <= X:
                    dp[i + x] = True
    print(1 if dp[X] else 0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
dp=[0]*(100201)
dp[0]=1
for i in range(100001):
    if dp[i]>0:
        for j in range(6):
            dp[i+j+100]=1
if dp[n]>0:
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

q = X // 100
r = X % 100

if q*5 < r:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
x = int(input())
N = 500000
dp = [False] * N
dp[0] = True
for i in range(N - 110):
    dp[i + 100] |= dp[i]
    dp[i + 101] |= dp[i]
    dp[i + 102] |= dp[i]
    dp[i + 103] |= dp[i]
    dp[i + 104] |= dp[i]
    dp[i + 105] |= dp[i]
print(0 + dp[x])

Submission status: Accepted

Solution code:
x = int(input())
MIN = (x // 100) * 100
MAX = (x // 100) * 105
if MIN <= x <= MAX:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

n =int(input())


a = n // 100
b = n % 100
if b > a*5:
    print("0")
else:
    print("1")

Submission status: Accepted

Solution code:
x = int(input())

dp = [1] + [0] * x
for i in range(x):
    if not dp[i]:
        continue
    for j in range(100, 106):
        if i + j <= x:
            dp[i + j] = 1
print(dp[x])

Submission status: Accepted

Solution code:
X = input()
for i in range(1001):
  if 0<=X-100*i<=5*i:
    print 1
    break
else:
  print 0

Submission status: Accepted

Solution code:
n = int(input())
f = [0]*(n+1)
f[0] = 1
for x in range(1, n+1):
	for i in range(100, 106):
		if x-i >= 0 and f[x-i] == 1:
			f[x] = 1
print(f[n])