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:
n = int(input())
low = 0
high = 0
for _ in range(1000):
  low += 100
  high += 105
  if low <= n <= high:
    print(1)
    exit()
print(0)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
def main(x: int):
    c = x // 100

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


if __name__ == '__main__':
    x = int(input())

    main(x)

Submission status: Accepted

Solution code:
total = int(input())
x, y = divmod(total, 100)
z,a = divmod(y, 5)
if a:
	z += 1
if z > x:
	print(0)
else:
	print(1)

Submission status: Accepted

Solution code:
X = int(input())
def countWays(costList, aim):
    an = [1] + [0]*(10**5+105)
    for i in range(aim):
        for j in costList:
           an[i+j] = max(an[i+j],an[i])
    return an[aim]

print(countWays([100,101,102,103,104,105],X))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys
input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

# import math
# import string
# import fractions
# from fractions import Fraction
# from fractions import gcd

# def lcm(n,m):
#     return int(n*m/gcd(n,m))

# import re
# import array
# import copy
# import functools
# import operator

# import collections
# import itertools
# import bisect
# import heapq


# from heapq import heappush
# from heapq import heappop
# from heapq import heappushpop
# from heapq import heapify
# from heapq import heapreplace

# from queue import PriorityQueue as pq

# def reduce(p, q):
#     common = fractions.gcd(p, q)
#     return (p//common , q//common )
# # from itertools import accumulate
# # from collections import deque

# from operator import mul
# from functools import reduce

# def combinations_count(n, r):
#     r = min(r, n - r)
#     numer = reduce(mul, range(n, n - r, -1), 1)
#     denom = reduce(mul, range(1, r + 1), 1)
#     return numer // denom

# import random

def main():
    x = int(input().strip())
    d10 = x%100
    
    a=0
    b=0
    c=0
    d=0
    e=0
    
    f = d10//5
    
    if d10%5==0:
        pass
    elif d10%5==1:
        b=1
    elif d10%5==2:
        c=1
    elif d10%5==3:
        d=1
    elif d10%5==4:
        e=1
    else:
        try:
            raise ValueError("error!")
        except ValueError as e:
            eprint(e)

    if (b+c+d+e+f)*100<=x:
        print(1)
    else:
        print(0)
    return

if __name__ == '__main__':
    main()


'''
for given X (1<=X<=10**5).
exits (a,b,c,d,e,f \in [0...10**6]).
100*a + 101*b + 102*c + 103*d + 104*e + 105*f == X



100*(a+b+c+d+e+f) + (b + 2*c + 3*d + 4*e + 5*f) == X
(b + 2*c + 3*d + 4*e + 5*f) == X - 100*(a+b+c+d+e+f)

Xの下二桁をみると，
(b + 2*c + 3*d + 4*e + 5*f) % 100 =  (Xの下二桁) ---(1)
かつ
X >= 

100*(a+b+c+d+e+f) 
が成立．


このとき
(1)を満たす中で
b+c+d+e+fが最小の場合を考えると
let d0 and  d1 (0 <= d0,d1 <= 9) such that
	10*d1 + 1*d0  = (Xの下二桁)

(10*d1 + 1*d0) // 5 -> f
(10*d1 + 1*d0) % 5 -> 
(if 1 then b else b ->0
 if 2 then c else c ->0
 if 3 then d else d ->0
 if 4 then e else e ->0
)
の場合であることが分かる．(後述)
このとき
Xが小さすぎなければ，
乃ち
100*(b+c+d+e+f) <= X 
のとき，乃ち
  ( (100*(b+c+d+e+f) <= X) and ((b + 2*c + 3*d + 4*e + 5*f) % 100 == (Xの下二桁)) )

such that 
 (但し b,c,d,e は
  (10*d1 + 1*d0) // 5 -> f
  (10*d1 + 1*d0) % 5 -> 
  (if 1 then b else b ->0
   if 2 then c else c ->0
   if 3 then d else d ->0
   if 4 then e else e ->0
  )
 )

のとき，
for given X (1<=X<=10**5).
exits (a,b,c,d,e,f \in [0...10**6]).
100*a + 101*b + 102*c + 103*d + 104*e + 105*f == X
は必ず成立する

'''

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

A1 = X % 100
count = 0
while A1 >= 5:
    count += 1
    A1 -= 5
while A1 >= 4:
    count += 1
    A1 -= 4
while A1 >= 3:
    count += 1
    A1 -= 3
while A1 >= 2:
    count += 1
    A1 -= 2
while A1 >= 1:
    count += 1
    A1 -= 1
if count <= X // 100:
    print('1')
else:
    print('0')

Submission status: Accepted

Solution code:
X = int(input())

a, b = X//100, X%100

if -(-b//5) <= a:
    print("1")
else:
    print("0")

Submission status: Accepted

Solution code:
X=int(input())
#ldp=[0 for i in range(X+1)]
ldp=[0 for i in range(max(106,X+1))]
#if X>=100:
for i in range(100,106):
    ldp[i]=1
if X>=105:
    for i in range(106,X+1):
        if sum(ldp[i-105:i-99])>=1:
            ldp[i]=1

print(ldp[X])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())

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

Submission status: Accepted

Solution code:
X = int(input())

dp = [False for _ in range(110000)]
dp[0] = True

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

for i in range(X + 1):
    if dp[i]:
        for p in price:
            dp[i + p] = True

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

Submission status: Accepted

Solution code:
x=int(input())
if x>=2000:
    print(1)
else:
    ko=x//100
    hasu=x-ko*100
    if hasu>ko*5:
        print(0)
    else:
        print(1)

Submission status: Accepted

Solution code:
import sys
n = int(input())
if n<100:
  print(0)
  sys.exit()

a = n%100
if a==0:
  print(1)
  sys.exit()
b = n//100
if 5*b<a:
  print(0)
  sys.exit()
for i in range(b+1):
  for j in range(b-i+1):
    for k in range(b-i-j+1):
      for l in range(b-i-j-k+1):
        for m in range(b-i-j-k-l+1):
          if i+2*j+3*k+4*l+5*m==a:
            print(1)
            sys.exit()
print(0)

Submission status: Accepted

Solution code:
x = int(input())

if (x//100)*5 >= x%100:
  print('1')
else:
  print('0')

Submission status: Accepted

Solution code:
x = int(input())

if x>=2000:
  print('1')
elif x<100:
  print('0')
else:
  j = x%100
  k = x//100
  if k*5 >= j:
    print('1')
  else:
    print('0')

Submission status: Accepted

Solution code:
X = int(input())

c = X//100

if (c*100 <= X) and (X <= c*105):
	print('1')
else:
	print('0')

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from collections import deque
import re
import math
import functools

def sRaw():
    return input().rstrip("\r")

def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))

INF = 1 << 29


def make1d_arr(n, val=INF):
    return [val for i in range(n)]


def make2d_arr(h, w, val=INF):
    return [[val for i in range(w)]for i in range(h)]


def gcd(a, b):
    if(b == 0):
        return a
    return gcd(b, a % b)


def BFord(n,es):
    v_cost = [INF]*n
    v_cost[0] = 0
    for v in range(n*2):
        for e in es:
            frm = e[0]
            to = e[1]
            if v_cost[to] > v_cost[frm]+e[2]:
                v_cost[to] = v_cost[frm]+e[2]
                if v >= n:
                    v_cost[to] = -INF
        if v == n-1:
            prev = v_cost[:]
    v_cost = [-INF if prev[idx]!=v_cost[idx] else v_cost[idx] for idx in range(n)]
    return v_cost
    
def ZAlgo(s):
    l = len(s)
    A = [0]*l
    i =1
    j =0
    A[0]=l
    while i<l:
        while i+j<l and s[j] == s[i+j]:
            j+=1
        if j==0:
            i+=1
            continue
        A[i]=j
        k=1
        while (i+k<l) and (k+A[k]<j):
            A[i+k] =A[k]
            k+=1
        i+=k
        j-=k
    return A


DIV = 998244353

def main():
    X = iRaw()
    dp = [0]*(X+1)
    dp[0] =1
    for x in range(100,X+1):
        for d in range(100,106):
            if dp[x-d]==1:
                dp[x] = 1
                break
    return dp[X]

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

Submission status: Accepted

Solution code:
import sys

x = input()

if len(x) < 3:
    print(0)
    sys.exit()

prefix = int(x[:-2])
suffix = int(x[-2:])

n = 0
for item in range(5, 0, -1):
    n += suffix // item
    suffix %= item

print(0 if n>prefix else 1)

Submission status: Accepted

Solution code:
X = int(input())

import numpy as np

J = np.zeros(X+1, dtype="bool")
# J[i] は、 i円の買い物ができるときにTrue, できないとFalse
J[0] = True
J[1:100] = False
J[100:106] = True
for i in range(106, X+1):
    if J[i - 100] or J[i - 101] or J[i - 102] or J[i - 103] or J[i - 104] or J[i - 105]:
        J[i] = True
    else:
        J[i] = False

if J[X] == True:
    print("1")
else:
    print("0")

Submission status: Accepted

Solution code:
import sys
import itertools

x = int(input())

nums = [100, 101, 102, 103, 104, 105]
if x >= 2000:
	print(1)
else:
	for i in range(20):
		for balls in itertools.combinations_with_replacement(nums, i):
			if sum(balls) == x:
				print(1)
				sys.exit()	
	else:
		print(0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def get_d_1(n):
    return n % 10


def get_d_2(n):
    return (n % 100) // 10


def solve(X):
    while X > 0:
        d_1 = get_d_1(X)
        d_2 = get_d_2(X)
        if d_2 == 0:
            if d_1 == 0:
                return 1
            else:
                if d_1 > 5:
                    X -= 105
                else:
                    X -= 100 + d_1
        else:
            X -= 105
    if X == 0:
        return 1
    else:
        return 0


X = int(input())
print(solve(X))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

MAX_NUM = 1000000

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

Submission status: Accepted

Solution code:
# 2019/12/7

# DPver

x=int(input())

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

dp[0]=1
for i in range(len(c)):
    for j in range(1,x+1):
        if c[i]>j:continue
        if dp[j-c[i]]:dp[j]=1
print(1 if dp[-1] else 0)

Submission status: Accepted

Solution code:
import math


def inputIntList():
    return [int(s) for s in input().split()]


def inputInt():
    return int(input())


inf = float("inf")


def main():
    total = inputInt()

    dp = [0 for _ in range(total + 1)]

    for i in range(100, total + 1):
        for j in range(100, 106):
            if dp[i] < i:
                dp[i] = dp[i - j] + j
    return 1 if dp[total] == total else 0


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

Submission status: Accepted

Solution code:
def solve(x):
    dp = [False] * (x+110)
    dp[0] = True
    for i in range(x+1):
        if dp[i]:
            for j in range(100, 106):
                dp[i+j] = True
    return int(dp[x])

x = int(input())
print(solve(x))

Submission status: Accepted

Solution code:
x = int(input())

num = x / 100

dp = [0] * (x + 1)
dp[0] = 1

for i in range(1, x + 1):
    if i <= 99:
        dp[i] = 0
    elif i in (100, 101, 102, 103, 104, 105):
        dp[i] = 1
    elif 1 in (dp[i - 100], dp[i - 101], dp[i - 102], dp[i - 103], dp[i - 104], dp[i - 105]):
        dp[i] = 1
    else:
        dp[i] = 0

print dp[x]

Submission status: Accepted

Solution code:
x = int(input())

num = x / 100

dp = [0] * (x + 1)
dp[0] = 1

for i in range(1, x + 1):
    if i <= 99:
        dp[i] = 0
    elif i in (100, 101, 102, 103, 104, 105):
        dp[i] = 1
    else:
        if 1 in (dp[i - 100], dp[i - 101], dp[i - 102], dp[i - 103], dp[i - 104], dp[i - 105]):
            dp[i] = 1
        else:
            dp[i] = 0

print dp[x]

Submission status: Accepted

Solution code:
X=int(input())
Y=(X-1)/1.05
A=X//100
B=Y//100
if A==B:
  print(0)
else:
  print(1)

Submission status: Accepted

Solution code:
x = int(input())

num = x // 100



dp = ["?"] * (x+1)
dp[0] = "1"

for i in range(1,x+1):
    if i <= 99:
        dp[i] = "0"
    elif i in (100,101,102,103,104,105):
        dp[i] = "1"
    else:
        if "1" in(dp[i-100],dp[i-101],dp[i-102],dp[i-103],dp[i-104],dp[i-105]):
            dp[i] = "1"
        else:
            dp[i] = "0"

            
print(dp[x])

Submission status: Accepted

Solution code:
#config:utf-8
x = input()

if int(x) < 100:
    print(0)
elif 5 * int(x[0:-2]) >= int(x[-2:]):
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x = int(input())

a = int(x/100)
b = x % 100

if b > a*5:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
X = int(input())

if X >= 2000:
    print(1)

else:
    num = X // 100
    res = 0

    for a in range(num+1):
        for b in range(num-a+1):
            for c in range(num-(a+b)+1):
                for d in range(num-(a+b+c)+1):
                    for e in range(num-(a+b+c+d)+1):
                        for f in range(num-(a+b+c+d+e)+1):
                            if a*100 + b*101 + c*102 + d*103 + e*104 + f*105 == X:
                                res = 1
                                break

    print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
x = int(input())

# 上から減らす
num = math.ceil(x/105)
remain = num * 105 - x

can = False
if remain < num * 5:
  can = True
else:
  # 下から増やす
  num = math.floor(x/100)
  remain = x - num * 100

  if remain < num * 5:
    can = True

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

Submission status: Accepted

Solution code:
import itertools

x = int(input())
my_iter = itertools.combinations_with_replacement([0,1,2,3,4,5], int(x/100))
for p in my_iter:
    s = sum(p)
    if sum(p) % 100 == x % 100:
        z_c = len(list(filter(lambda x:x == 0, p)))
        if z_c >= int(sum(p) / 100):
            print(1)
            break
else:
    print(0)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#三井住友信託銀行プログラミングコンテスト2019 C

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

x = I()
y,z = divmod(x,100)
if y*5 >= z:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())

A100 = 0
A105 = 0
for i in range(1001):
    A100 += 100
    A105 += 105
    if A100 <= X <= A105:
        print("1")
        exit()

print("0")

Submission status: Accepted

Solution code:
X =int(input())
if X > 2000:
    print(1)
    quit()
lst = []
for i in range(20):
    lst.append([i * 105 + 1, i * 100 + 99])
for item in lst:
    if X >= item[0] and X <= item[1]:
        print(0)
        quit()
print(1)

Submission status: Accepted

Solution code:
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

X = int(sys.stdin.buffer.readline())
l = 0
h = 0
while l <= X:
    l += 100
    h += 105
    if l <= X <= h:
        print(1)
        exit()
print(0)

Submission status: Accepted

Solution code:
x=int(input())
print(int((x-1)//105!=x//100))

Submission status: Accepted

Solution code:
X = int(input().strip())

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

Submission status: Accepted

Solution code:
x = int(input())
a,b = divmod(x,100)
print(int(a*5>=b))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

X=int(input())
a=X%100
b=X//100
c=a%5
d=a//5
e=c%4
f=c//4
g=e%3
h=e//3
i=g%2
j=g//2
if b>=(d+f+h+j+(X-100*b-5*d-4*f-3*h-2*j)):
    print("1")
else:
    print("0")

Submission status: Accepted

Solution code:
XMAX = 10**5
X = int(input())
dp = [False] * (XMAX + 1)
dp[0] = True

for i in range(0, X + 1):
    for p in range(100, 106):
        if i - p >= 0 and dp[i - p]:
            dp[i] = True
            next
if dp[X]:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())
for i in range(1, X + 1):
    if X >= 100 * i and X <= 105 * i:
        print(1)
        exit()
print(0)

Submission status: Accepted

Solution code:
X = int(input())

if X >= 100:
    if X % 100 == 0:
        print(1)
        exit()
elif 0 <= X <= 99:
    print(0)
    exit()

a = X // 105
b = a * 105 + 1
c = str(a) + '9' * 2
c = int(c)

if b <= X <= c:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
X =int(input())
if X > 10100:
    print(1)
    quit()
lst = []
for i in range(20):
    lst.append([i*105+1, i*100+99])
for item in lst:
    if X >= item[0] and X<=item[1]:
        print(0)
        quit()
print(1)

Submission status: Accepted

Solution code:
x=int(input())

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

Submission status: Accepted

Solution code:
X = int(input())

if X >= 2000:
    print(1)
else:
    for n in range(1, 20):
        if 100 * n <= X <= 105 * n:
            print(1)
            break
    else:
        print(0)

Submission status: Accepted

Solution code:
X = int(input())

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

for i in range(X):
    if dp[i] == 1:
        for v in range(100, 105 + 1):
            if i+v <= X:
                dp[i+v] = 1
print(dp[X])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

num_of_product = x // 100
amari = x % 100

if num_of_product * 5 < amari:
	print("0")
else:
	print("1")

Submission status: Accepted

Solution code:
X = int(input())
dp = [1]+[0]*X
for i in range(X):
  if i+1 < 100: dp[i+1] = 0
  elif i+1 <=105: dp[i+1] = 1
  elif sum([dp[i+1-(100+j)] for j in range(6)])>0: dp[i+1] = 1
  else: dp[i+1] = 0
print(dp[-1])

Submission status: Accepted

Solution code:
X = int(input())

d100 = X // 100
if 100 * d100 <= X <= 105 * d100: print('1')
else: print('0')

Submission status: Accepted

Solution code:
x = int(input())
c = x//100
flg = False
for i in range(c+1):
  if 100*i <= x <= 105*i:
    flg = True
    break
print(1 if flg else 0)

Submission status: Accepted

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

    if x<100:
        print(0)
        return
    elif x<106:
        print(1)
        return

    dp = [False for _ in range(x+1)]
    for i in range(6):
        dp[100+i] = True

    # calc
    for i in range(106, x+1):
        for j in range(6):
            if dp[i-100-j]:
                dp[i] = True
                break

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())
v = X % 100

f = v // 5
v -= f * 5

e = v // 4
v -= e * 4

d = v // 3
v -= d * 3

c = v // 2
v -= d * 2

b = v // 1
v -= b

a = (X - (101 * b + 102 * c + 103 * d + 104 * e + 105 * f)) // 100
print(1 if 0 <= a else 0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

N_100 = N // 100

ANS = 1

if N_100 == 0:
  ANS = 0

for i in range(20):
  if (N > (i + 1) * 100 + (i + 1)*5) and (N < ((i + 2) * 100)):
    ANS = 0
    break

if ANS == 0:
  print(0)
else:
  print(1)

Submission status: Accepted

Solution code:
n = int(input())
print([0, 1][n%100<=5*(n//100)])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  X = int(input())
  max = X // 100
  two = X - max * 100
  count = 0
  for i in range(5 ,0, -1):
    count += two // i
    two %= i
  print(0) if count > max else print(1)


if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
amari = x%100

for i in range(5,0,-1):
    x -= (100+i)*(amari//i)
    amari = amari%i

if x >= 0:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())

for i in range(X+1):
  if X >= 100*i and X <= 105*i:
    print(1)
    exit(0)
print(0)

Submission status: Accepted

Solution code:
import sys
from functools import lru_cache

N = int(input())
sys.setrecursionlimit(10 ** 9)


@lru_cache(maxsize=10 ** 9)
def dfs(x):
    ans = False
    if x == 0:
        return True
    elif x < 0:
        return False
    else:
        ans |= dfs(x - 100)
        ans |= dfs(x - 101)
        ans |= dfs(x - 102)
        ans |= dfs(x - 103)
        ans |= dfs(x - 104)
        ans |= dfs(x - 105)
    return ans

print(1 if dfs(N) else 0)

Submission status: Accepted

Solution code:
x = int(input())

dp = [0] * (10**5+1)
dp[0] = 1

for i in range(len(dp) - 105):
    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

print(dp[x])

Submission status: Accepted

Solution code:
x = int(input())

dp = [0] * 100001

dp[100] = dp[101] = dp[102] = dp[103] = dp[104] = dp[105] = 1

for i in range(106, 100001):
    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[x])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

X = int(input())

i = 0
j = 0
while i < 1:
  q = (X - (100 * j)) // 100
  r = (X - (100 * j)) % 100 + (100 * j)
  
  if math.ceil(r / 5) <= q:
    print(1)
    break
    
  if (X - (100 * (j + 1))) <= 0:
    print(0)
    break
  
  j += 1

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

x = int(input())
if x >= 2100:
    print(1)
    exit()
n = x // 100
rest = x % 100
if rest <= n * 5:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())

# iがそんなに大きくないのでiについてループを回すことができる．dpiを"i円の買い物ができるなら，"Yes","No""とします．
# dp0を'Yes'とする．
# dpi-100~105が'True'ならばdpiは0．それ以外ならば'False'
DP = [True]
for i in range(X): 
    if i+1-105 >= 0:
        DP_n = DP[i+1-100] or DP[i+1-101] or DP[i+1-102] or DP[i+1-103] or DP[i+1-104] or DP[i+1-105] 
    elif i+1==100 or i+1==101 or i+1==102 or i+1==103 or i+1==104:
        DP_n = True
    else:
        DP_n = False
    DP.append(DP_n)
print(int(DP[X]))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

X = int(input())

for i in range(100000):
    if 100 * i <= X <= 100 * i + 5 * i:
        print(1)
        exit()

print(0)

Submission status: Accepted

Solution code:
x=int(input())
if x<100:
	print(0)
elif x>=100:
	a=int(str(x)[-2:])
	b=int(str(x)[:-2])
	counter=0
	while a>=5:
		a-=5
		counter+=1
	while a>=4:
		a-=4
		counter+=1
	while a>=3:
		a-=3
		counter+=1
	while a>=2:
		a-=2
		counter+=1
	while a>=1:
		a-=1
		counter+=1
	print(1 if counter<=b else 0)

Submission status: Accepted

Solution code:
X = int(input())
flag = 0

for i in range(1,1000001):
  if 100*i <= X and 105*i >=X:
    flag = 1
    
if flag == 1:
  print("1")
else:
  print("0")

Submission status: Accepted

Solution code:
x = int(input())
f = False
for d in range(10000):
    if 100 * d > x:
        break
    if 0 <= x - 100 * d <= 5 * d:
        f = True
print(int(f))

Submission status: Accepted

Solution code:
X=int(input())

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

if 100<=X<=105:
    print(1)
    exit()

DP=[False]*(X+1)

for i in range(100,106):
    DP[i]=True

for i in range(106,X+1):
    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]=True

if DP[X]==True:
    print(1)
elif DP[X]==False:
    print(0)

Submission status: Accepted

Solution code:
x = int(input())
for i in range(1001):
  a = i*100
  b = i*105
  if a <= x <= b:
    print(1)
    exit()
    
print(0)

Submission status: Accepted

Solution code:
x=int(input())
ans=0
c=1
for i in range(1,x):
    l,r=100*i,105*i
    if x>=l and x<=r:
        ans=1
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
number=int(input())
div100=int(number//100)
get100=div100*100
diff100=number-get100
div5=int(diff100//5) #24...div5 4 mod5 4
mod5=diff100%5
if (div5*100<number and number>=100 and div100*5>=diff100)or diff100%100==0:
  print("1")
else:
  print("0")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

simo = X%100
uwa = (X - simo) // 100

syou = ((simo-1) // 5)

if uwa > syou:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())

dp = [0] * (X+106)
dp[0] = 1

for i in range(X+1):
    if dp[i] == 1:
        for j in range(100,106):
            dp[i+j] = 1

print(dp[X])

Submission status: Accepted

Solution code:
x = int(input())
m = x // 100
n = x % 100
# x = 100m+n
# 0~5までの数を合計m回使用して和をnにすることができるか
# nが5の倍数の時，n//5<=mであれば良い
# nが5の倍数でない時，n//5<=m-1であれば良い
import math
if math.ceil(n/5) <= m:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
a = int(input())
tmp01 = a/100
tmp02 = a/105
n = a//100
#print(tmp01,n,tmp02)
if tmp01 >= n >= tmp02:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
x = int(input())

dp = [False] * (x+1)
dp[0] = True
for i in range(1,x+1):
    if i < 99:
        continue
    else:
        if dp[i-100]:
            dp[i] = True
        elif dp[i-101]:
            dp[i] = True
        elif dp[i-102]:
            dp[i] = True
        elif dp[i-103]:
            dp[i] = True
        elif dp[i-104]:
            dp[i] = True
        elif dp[i-105]:
            dp[i] = True

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

Submission status: Accepted

Solution code:
X = int(input())

check = [0]*(X+106)
check[0] = 1
for i in range(X+1):    ##0-Xまで
    if check[i] == 1:
        for tmp in [100, 101, 102, 103, 104, 105]:
            check[i + tmp] = 1


print(check[X])

Submission status: Accepted

Solution code:
X = int(input())

num = X // 100

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

Submission status: Accepted

Solution code:
x = int(input())

dp = [0]*(x+106)
dp[0] = 1
for i in range(x+1):
    if(dp[i]):
        for tmp in [100, 101, 102, 103, 104, 105]:
            dp[i+tmp] = 1
print(dp[x])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
mod = X % 100
q = int(X //100)
sum = 0
ans = 0
if q >= 100:
    ans = 1
else:
    for i in range (0,q+1):
        for j in range (0,q+1-i):
            for k in range (0,q+1-i-j):
                for l in range (0,q+1-i-k-j):
                    for m in range (0,q+1-i-j-k-l):
                        sum = i+(2*j)+(3*k)+(4*l)+(5*m)
                        if sum == mod:
                            ans = 1
print(ans)

Submission status: Accepted

Solution code:
X = int(input())
mod = X % 100
q = int(X //100)
sum = 0
ans = 0
if q >= 20:
    ans = 1
else:
    for i in range (0,q+1):
        for j in range (0,q+1-i):
            for k in range (0,q+1-i-j):
                for l in range (0,q+1-i-k-j):
                    for m in range (0,q+1-i-j-k-l):
                        sum = i+(2*j)+(3*k)+(4*l)+(5*m)
                        if sum == mod:
                            ans = 1
print(ans)

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())

dp = [False]*(X+1)
dp[0] = True

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

print(int(dp[X]))

Submission status: Accepted

Solution code:
x = int(input())
c = x // 100
if 100*c <= x and x <= 105*c:
    print(1)
    exit(0)
print(0)

Submission status: Accepted

Solution code:
x = int(input())

x1 = x // 100
x0 = x % 100

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

ans = int(x1 >= cnt)
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys

X = int(input())

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

list_X = list(str(X))

one_X = list_X[-1]
ten_X = list_X[-2]

nessesary_money = 105 * 2 * int(ten_X)
if int(one_X) > 0 and int(one_X) <= 5:
    nessesary_money += 100 + int(one_X)
elif int(one_X) > 5:
    nessesary_money += 200 + int(one_X)

if nessesary_money <= X:
    print(1)
else:
    print(0)