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:
def main():
    x = int(input())

    n = x // 100

    if 0 <= x - 100 * n <= 5 * n:
        print(1)
    else:
        print(0)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

    for i in range(x + 1):
        if 0 <= x - 100 * i <= 5 * i:
            print(1)
            exit()
    else:
        print(0)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

    a_100 = x // 100
    b_100 = x % 100
    a_5 = b_100 // 5
    b_5 = b_100 % 5
    a_4 = b_5 // 4
    b_4 = b_5 % 4
    a_3 = b_4 // 3
    b_3 = b_4 % 3
    a_2 = b_3 // 2
    b_2 = b_3 % 2
    a_1 = b_2 // 1
    b_1 = b_2 % 1

    if a_5 + a_4 + a_3 + a_2 + a_1 > a_100:
        ans = 0
    else:
        ans = 1

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


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


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    X = int(input())

    dp = [0] * 100100
    dp[0] = 1
    for p in range(100, 106):
        for i in range(len(dp)):
            if dp[i] == 1 and i + p < len(dp):
                dp[i + p] = 1

    print(dp[X])


def main():
    solve()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
x = input()
if len(x) < 3:
    print(0)
    exit()
k = int(x[0:-2])
x = int(x[-2:])

k -= x / 5
if x % 5 == 0 and k >= 0:
    print(1)
elif k > 0:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x = int(input())
li = [0]*100105
li[0] = 1
for i in range(x):
    if li[i] == 1:
        for j in range(6):
            li[i+j+100] = 1
print(li[x])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
a = [0, 1, 2, 3, 4, 5]
x = int(input())
n = x // 100
m = x % 100
for c in itertools.combinations_with_replacement(a, n):
    if sum(c) == m:
        print(1)
        break
else:
    print(0)

Submission status: Accepted

Solution code:
x = int(input())

num = x // 100
sur = x % 100
if sur <= num * 5:
    print(1)
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())

p = X % 100
q = p // 5
r = p % 5
ans = q
if r > 0:
    ans += 1
ans = ans * 100 + p
if X >= ans:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())

count = X // 100
mod = X % 100

if mod <= count*5:
  print(1)
else:
  print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
cnt = x//100

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
c, r = 0, X % 100
for d in range(5, 0, -1):
    c += r // d
    r = r % d
if c > X // 100:
    print(0)
else:
    print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

q,mod = divmod(X,100) 
#100*q<=X<=(100+5)*q
#0<=mod_x<=5q :1

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

Submission status: Accepted

Solution code:
x = int(input())

dp = [0]*200000
for j in range(6):
  dp[100+j] += 1

def max_sum():
  global dp
  for i in range(x):
    if dp[i] > 0:
      for j in range(6):
        dp[i+100+j] += 1
  return


max_sum()
print(min(dp[x], 1))

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())

X = I()
q,r = X//100,X%100
if q*5 >= r:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())

q,mod = divmod(X,100)
if 5*q<mod:
  print(0)
else:
  print(1)

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())
for i in range(1000):
    if 100*i <= x <= 105*i:
        print(1)
        exit()
print(0)

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
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 = x // 100
z = x % 100
if 0 <= z <= 5*y:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inl = lambda: [int(x) for x in sys.stdin.readline().split()]
ins = lambda: sys.stdin.readline().rstrip()


def solve():
    x = ini()
    lb, ub = 0, 0
    while lb <= x:
        if lb <= x <= ub:
            return True
        lb += 100
        ub += 105
    return False


print(1 if solve() else 0)

Submission status: Accepted

Solution code:
X=int(input())
i=0
while True:
    if 100*i<=X and X<=105*i:
        print(1)
        exit()
    elif 105*i<X and X<100*(i+1):
        print(0)
        exit()
    i+=1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools as it
N=int(input())
S=[0,1,2,3,4,5]
for k in range(N//100):
  for i in it.combinations_with_replacement(S,N//100):
    if sum(i)==N%100:
      print("1")
      exit()
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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
N = X // 100
for n in range(N + 1):
  M = X - n * 100
  if M > n * 5:
    continue
  else:
    print(1)
    break
else:
  print(0)

Submission status: Accepted

Solution code:
x = int(input())

flag = 0
if x >= 2000:
    print(1)
    exit()
else:
    for i in range(20):
        for j in range(20):
            for k in range(20):
                for l in range(20):
                    for m in range(20):
                        for n in range(20):
                            if i*100+j*101+k*102+l*103+m*104+n*105 == x:
                                flag = 1
                                print(1)
                                exit()
if flag != 1:
    print(0)

Submission status: Accepted

Solution code:
n = int(input())
a = n // 100
b = n % 100
check = a > 20 or b / 5 <= a
print("1" if check else "0")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

l = -(-x//105)
h = x//100
#fix = l*100

for i in range(l,h+1):
    for b in range(0,i+1):
        for c in range(0,i+1):
            for d in range(0,i+1):
                for e in range(0,i+1):
                    if x - (i*100 + 1*b+2*c+3*d+4*e+5*(i-b-c-d-e)) == 0:
                            print('1')
                            exit()
else:
    print('0')

Submission status: Accepted

Solution code:
x = int(input())

l = -(-x//105)
h = x//100
fix = l*100

for b in range(0,h+1):
    for c in range(0,h+1):
        for d in range(0,h+1):
            for e in range(0,h+1):
                for f in range(0,h+1):
                    if fix + 1*b+2*c+3*d+4*e+5*f==x:
                        print('1')
                        exit()
else:
    print('0')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
a = X % 100
sum = 0
for i in range(5, 0, -1):
    sum += a // i
    a %= i
if sum <= X // 100:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())

price = [100,101,102,103,104,105]
dp = [[0]*100001 for _ in range(6)]

dp[0][0] = 1
for i in range(100,100001):
    dp[0][i] = dp[0][i-100]

for i in range(1,6):
    for j in range(price[i]):
        dp[i][j] = dp[i-1][j]
    for j in range(price[i],100001):
        dp[i][j] = max(dp[i-1][j],dp[i][j-price[i]])

print(dp[-1][X])

Submission status: Accepted

Solution code:
import collections
import sys
import math
X=int(input())
if X<100:
    print("0")
    sys.exit()
amari=math.floor(X/100)
kake=amari*5
if amari*100<=X<=amari*100+kake:
    print("1")
else:
    print("0")

Submission status: Accepted

Solution code:
from itertools import combinations_with_replacement as C

X = int(input())
mono = [100, 101, 102, 103, 104, 105]
ans = 0
if X >= 2000:
    ans = 1
else:
    for i in range(1, 19 + 1):
        L = list(C(mono, i))
        for L in L:
            if sum(L) == X:
                ans = 1
                break

print(ans)

Submission status: Accepted

Solution code:
X = int(input())
for i in range(105, 100, -1):
    while True:
        if X % 100 < (X-i) % 100:
            break
        else:
            X = X-i
if X < 0: X = 1
print(1 if X % 100 == 0 else 0)

Submission status: Accepted

Solution code:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

x = inint()

res = x % 100
lim = x//100

c = res//5
res %= 5
c += res//4
res %= 4
c += res//3
res %= 3
c += res//2
res %= 2
c += res//1
res %= 1

if lim < c:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
dp = [False] * (x + 1)
dp[0] = True

items = [100, 101, 102, 103, 104, 105]
for i in items:
    for j in range(x + 1):
        if j + i >= x + 1:
            break
        dp[j + i] |= dp[j]
if dp[x]:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
s = int(input())
a = s%100
b = s//100

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

for c in range(1, 1000001):
  if c * 100 <= X and X <= c * 105:
    ans = 1
    break
  else:
    ans = 0

print(ans)

Submission status: Accepted

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

for i in range(100, x+1):
    for p in [100, 101, 102, 103, 104, 105]:
        dp[i+p] = max(dp[i], dp[i+p])

print(dp[x])

Submission status: Accepted

Solution code:
x = int(input())
c = 1
while True:
    if c*100 <= x <= c*105:
        print(1)
        break

    if c*100 > x:
        print(0)
        break
    c += 1

Submission status: Accepted

Solution code:
x=int(input())

dp=[[0]*(x+1) for _ in range(7)]
dp[0][0]=1
price=list(range(100,106))

for i in range(6):
    p=price[i]
    for j in range(x+1):
        dp[i+1][j]=dp[i][j]

        if j>=p:
            dp[i+1][j]+=dp[i+1][j-p]

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

Submission status: Accepted

Solution code:

X = int(input())

dp = [False] * (X + 1)
cost = [100, 101, 102, 103, 104, 105]
dp[0] = True
for i in range(X):
    for j in range(6):
        if dp[i] and i + cost[j] <= X:
            dp[i + cost[j]] = True

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

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

n = X % 100
m = X // 100

cnt = 0
for a in reversed(range(1, 6)):
    while n - a >= 0:
        n -= a
        cnt += 1

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

Submission status: Accepted

Solution code:
x=int(input())
if x>=2100:
  print(1)
  exit()

ans=[0]*2100
for a in range(22):
  for b in range(22):
    for c in range(22):
      for d in range(22):
        for e in range(22):
          for f in range(21):
            y=a*100+b*101+c*102+d*103+e*104+f*105
            if y<=2099:
              ans[y]=1
            
print(ans[x])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

x1 = X // 100
x2 = X % 100

if x2 <= x1 * 5:
    print(1)
else:
    print(0)

Submission status: Accepted

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

if x >= 2600:
    print(1)
    exit()

cnt = 0
for i in range(0, 25):
    for v in itertools.combinations_with_replacement([100, 101, 102, 103, 104, 105], i):
        if sum(v) == x:
            print(1)
            exit()
print(0)

Submission status: Accepted

Solution code:
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    x = int(input())
    dp = [0 for _ in range(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])
    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

X = int(input())

costs = [105, 104, 103, 102, 101, 100]
for x in range(X):
    if 100 * x <= X <= 105 * x:
        print(1)
        quit()
print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
x=int(input())
y=x//100
z=math.ceil((x%100)/5)
if y >= z:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


X = z()
lis = list(range(100, 106))

max_num_item = int(X / 100)
min_num_item = int(X / 105)

for num_item in range(min_num_item, max_num_item + 1):
    tmp_x = X
    tmp_x = tmp_x - 100 * num_item
    if (tmp_x <= num_item * 5):
        print(1)
        exit()
print(0)

Submission status: Accepted

Solution code:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
from math import ceil

x=ni()
p=x%100
if ceil(p/5) <= x//100:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
x = int(input())
dp = [0]*(x+1+105)
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>=10000 or x//100*5>=x%100:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
def resolve():
    x = int(input())
    dp = [0] * (x+1+105)
    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])
resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())
han=0
for a in range(1001):
    if a * 100 > X:
        break
    for b in range(1001-a):
        if a * 100 + b * 101 > X:
            break
        for c in range(1001-a-b):
            if a * 100 + b * 101 + c * 102 > X:
                break
            for d in range(1001-a-b-c):
                if a * 100 + b * 101 + c * 102 + 103 * d> X:
                    break
                for e in range(1001-a-b-c-d):
                    if a * 100 + b * 101 + c * 102 + 103 * d + 104 * e>X:
                       break
                    for f in range(1001-a-b-c-d-e):
                        if a * 100 + b * 101 + c * 102 + 103 * d + 104 * e + 105 * f>X:
                            break
                        if a*100+b*101+c*102+103*d+104*e+105*f==X:
                            print("1")
                            han=1
                            exit()

if han==0:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
C = [100+i for i in range(6)]
T = [float('inf')]*(N+1)
T[0] = 0

for i in range(6):
    for j in range(C[i], N+1):
        T[j] = min(T[j], T[j - C[i]] + 1)

if T[N] != float('inf'):
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
import sys, math
from functools import lru_cache
from collections import deque
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

@lru_cache(maxsize=None)
def f(x):
    if x < 0:
        return False
    if (x%100==0) or (x%101==0) or (x%102==0) \
            or (x%103==0) or (x%104==0) or (x%105==0):
        return True
    return f(x-100) or f(x-101) or f(x-102) \
            or f(x-103) or f(x-104) or f(x-105)

def main():
    X = ii()
    print(1 if f(X) else 0)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
n=int(input())
dp=[0]*(10**5+1)
dp[100]=1
dp[101]=1
dp[102]=1
dp[103]=1
dp[104]=1
dp[105]=1
for i in range(106,10**5+1):
    if dp[i-100]==1:
        dp[i]=1
    elif dp[i-101]==1:
        dp[i]=1
    elif dp[i-102]==1:
        dp[i]=1
    elif dp[i-103]==1:
        dp[i]=1
    elif dp[i-104]==1:
        dp[i]=1
    elif dp[i-105]==1:
        dp[i]=1
print(dp[n])

Submission status: Accepted

Solution code:
x = int(input())

dp = [True] + [False] * (x+110)

for i in range(len(dp)):
    if not dp[i]: continue
    for food in range(100, 106):
        if i+food >= len(dp): continue
        dp[i+food] = True

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

Submission status: Accepted

Solution code:
# 初期入力　　２０２０－０７２７　21：50
import sys
input = sys.stdin.readline  #文字列では使わない
X = int(input())
ans =0
Possible =[]
if X >=2000:
    ans =1
else:
    Possible =[(i*100,i*105) for i in range(1,21)]
    for p in Possible:
        if p[0] <= X <=p[1]:
            ans =1
            break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

if x//100 > 19:
    print(1)
else:
    tmp1 = x%100
    tmp2 = x//100
    if 5*tmp2<tmp1:
        print(0)
    else:
        print(1)

Submission status: Accepted

Solution code:
X = int(input())

l = [1,2,3,4,5]
a = X // 100
b = X % 100

ans = 0
for i in l:
    if b % i == 0:
        if b // i <= a:
            ans = 1
            break

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

n = X//100
k = X % 100

if k <= 5*n:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
x = int(input())
ans = 0
flag = False
for a in range((x//100)+1):
  for b in range((x//101)+1):
    for c in range((x//102)+1):
      for d in range((x//103)+1):
        for e in range((x//104)+1):
          for f in range((x//105)+1):           
            if (100*a) + (101*b) + (102*c) + (103*d) + (104*e) + (105*f)== x:
              ans += 1
              flag = True
              break
          if flag:
            break
        if flag:
          break
      if flag:
        break
    if flag:
      break
  if flag:
    break
  
if ans == 0:
  print(0)
else:
  print(1)

Submission status: Accepted

Solution code:
def main2():
    x = int(input())
    r, m = divmod(x, 100)
    x -= r * 100

    count = 0

    while(x > 0):
        if x >= 5:
            x -= 5
            count += 1
        elif x >= 4:
            x -= 4
            count += 1
        elif x >= 3:
            x -= 3
            count += 1
        elif x >= 2:
            x -= 2
            count += 1
        elif x >= 1:
            x -= 1
            count += 1

    if r >= count:
        print(1)
    else:
        print(0)

if __name__ == "__main__":
    main2()

Submission status: Accepted

Solution code:
X=int(input())
a=X//100
b=X%100

if b<=a*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(100, X+1):
  if i < 106:
    dp[i] = True
    continue
  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

print(1) if dp[len(dp)-1] else print(0)

Submission status: Accepted

Solution code:
import math
import sys
readline = sys.stdin.readline


def main():
    x = int(readline().rstrip())
    ans = x // 100
    if ans == 0:
        print(0)
        return

    sur = x - ans * 100
    print(1 if sur / ans <= 5 else 0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
b=0
x = N //100
for y in range(100*x,105*x+1):
  if N==y:
    print(1)
    exit()
print(0)

Submission status: Accepted

Solution code:
N=int(input())
b=0
for x in range(1,N//100+1):
  for y in range(100*x,105*x+1):
    if N==y:
      print(1)
      exit()
print(0)

Submission status: Accepted

Solution code:
x = int(input())

w = x // 100
y = x % 100

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

Submission status: Accepted

Solution code:
X = int(input())

N, r = divmod(X, 100)

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

Submission status: Accepted

Solution code:
N=int(input())
C=[]
b=0
for x in range(1,N//100+1):
  for y in range(100*x,105*x+1):
    if N==y:
      b=1
  if b==1:
    break
print(b)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
a = n % 100
b = n//100
if b >= (a//5 + (a % 5 != 0)):
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
dp = [True]  # i円の買い物ができるか
x = int(input())
for i in range(99):
    dp.append(False)
for i in range(100, x + 1):
    if(i < 106):
        dp.append(True)
    else:
        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.append(True)
        else:
            dp.append(False)
if(dp[x]):
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
import itertools
x = int(input())
a = x // 100
b = x - a * 100
arr = [0, 1, 2, 3, 4, 5]
ans = 0
for v in itertools.combinations_with_replacement(arr, a):
    k = sum(list(v))
    if k == b:
      ans = 1
      break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())
#m1,d1=map(int,input().split())
#hl=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

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

Submission status: Accepted

Solution code:
x = int(input())

for i1 in range(x//105, -1, -1):
  x2 = x - 105*i1
  for i2 in range(x2//104, -1, -1):
    x3 = x2 - 104*i2
    for i3 in range(x3//103, -1, -1):
      x4 = x3 - 103*i3
      for i4 in range(x4//102, -1, -1):
        x5 = x4 - 102*i4
        for i5 in range(x5//101, -1, -1):
          x6 = x5 -101*i5
          for i6 in range(x6//100, -1, -1):
            if x5 - 100*i6 == 0:
              print(1)
              exit()
print(0)

Submission status: Accepted

Solution code:
X = int(input())

q = X // 100

if X%100<=q*5:
  print('1')
else:
  print('0')

Submission status: Accepted

Solution code:
X = int(input())
dp = [0 for _ in range(X + 110)]
dp[0] = 1
for i in range(X + 1):
    if dp[i] == 0:
        continue
    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())

n=-1
for i in range(int(x/105),int(x/100)+1):
    n=i
# print(n)

if 0<=x-100*n<=5*n:
    print("1")
else:
    print("0")

Submission status: Accepted

Solution code:
x = int(input())
cnt = x//100
if x < 100 :
    print("0")
else :
    for i in range(cnt) :
        if 100*cnt <= x <= 105*cnt :
            print("1")
            break
    else :
        print("0")

Submission status: Accepted

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

if n%5:
    if 100*(n//5+1) <= x-n:
        print(1)
    else:
        print(0)
else:
    if 100*(n//5) <= x-n:
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    N = X // 100
    M = X % 100
    if M == 0:
        print(1)
        return
    if M % 5 == 0 and M // 5 <= N:
        print(1)
    elif M % 5 > 0 and M // 5 + 1 <= N:
        print(1)
    else:
        print(0)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
coins = [100,101,102,103,104,105]
dp = [int(i%coins[0]==0) for i in range(N+1)]
for coin in coins[1:]:
  for i in range(coin,N+1):
    dp[i] += dp[i - coin]
if dp[-1] != 0:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
x = int(input())

a = x-x//100*100
print(1) if a//5 + (a%5!=0) <= x//100 else print(0)

Submission status: Accepted

Solution code:
def resolve():
    X = int(input())
    dp = [0 for _ in range(X + 110)]
    dp[0] = 1
    for i in range(X + 1):
        if dp[i] == 0:
            continue
        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])


resolve()

Submission status: Accepted

Solution code:
x=int(input())
kosu=0
for i in range(1000):
    kosu+=1
    if 100*kosu<=x<=105*kosu:
        print(1)
        quit()
print(0)

Submission status: Accepted

Solution code:
dp = [True] #i円の買い物ができるか
x = int(input())
for i in range(99):
  dp.append(False)
for i in range(100, x+1):
  if(i < 106):
    dp.append(True)
  else:
    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.append(True)
    else:
      dp.append(False)
if(dp[x]):
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
# C - 100 to 105
ans = 0
X = int(input())
for i in range(1500):
    if 100*i<=X<=105*i:
        ans = 1
        break
print(ans)