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:
#!/usr/bin/env python3
import sys


def solve(X: int):
    dp = [[-1]*(X+1) for _ in range(7)]
    price = [100,101,102,103,104,105]
    m = [10**5]*6

    for i in range(7):
        dp[i][0] = 10**5

    ## i番目まででjを払えるか
    for i in range(6):
        for j in range(X+1):
            if dp[i][j]>=0:
                dp[i+1][j] = m[i]
            elif j < price[i] or dp[i+1][j-price[i]]<=0:
                dp[i+1][j] = -1
            else:
                dp[i+1][j] = dp[i+1][j-price[i]]-1

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

    return


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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import itertools
X = int(input())
price=[100,101,102,103,104,105]
num = int(X / 100)
state=False
for i in range(num,0,-1):
    for j in itertools.combinations_with_replacement(price, i):
        if sum(j) == X:
            print(1)
            state=True
            exit()
if state != True:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())
print(1 if X % 105 == 0 or X % 100 == 0 or X // 105 + 1 <= X // 100 else 0)

Submission status: Accepted

Solution code:
X = int(input())

mylist = [i + 100 for i in range(6)]

#print(mylist, X)

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

for m in mylist[1:]:
    for i in range(m, X+1):
        dp[i] += dp[i-m]


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

Submission status: Accepted

Solution code:
import math

X = int(input())

if(X < 100):
    print(0)
    exit
else:
    if (int(str(X)[-2])*10 + int(str(X)[-1])*1) % 5 == 0:
        if math.floor((int(str(X)[-2])*10 + int(str(X)[-1])*1) / 5) > math.floor(X / 100):
            print(0)
        else:
            print(1)
    else:
        if math.floor((int(str(X)[-2])*10 + int(str(X)[-1])*1) / 5) + 1 > math.floor(X / 100):
            print(0)
        else:
            print(1)

Submission status: Accepted

Solution code:
X = int(input())

last_two = X % 100
other = X - last_two
# print(last_two)
count = 0
flag = 0

for i in range(5, 0, -1):
    count += last_two // i
    last_two = last_two % i
    if last_two % i == 0:
        if count <= other // 100:
            flag = 1
            break
if flag == 1:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x=int(input())
memo=[0]*200000

for i in range(1,1000):
  temp=[1]*(5*i+1)
  memo[100*i:105*i+1]=temp
memo[100000]=1

if x<=100000:
  print(memo[x])
else:
  print(0)

Submission status: Accepted

Solution code:
def bag(x):
  max_num = x // 100
  print(int(max_num * 5 >= x % 100))
 
if __name__ == "__main__":
  import sys
  in_str = ''
  for line in sys.stdin:
    in_str += line
  n = [int(_) for _ in in_str.split()][0]
  bag(n)

Submission status: Accepted

Solution code:
import itertools

x = int(input())

if x < 100:
    print("0")
else:
    n = x // 100
    # r = x % 105
    # print(n, r)

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

    for balls in itertools.combinations_with_replacement(nums, n):
        # print(balls)
        if sum(balls) == x:
            print('1')
            break
    else:
        print('0')

Submission status: Accepted

Solution code:
X = int(input())
dp = [-1] * (X + 1)
dp[0] = 0
for val in [100, 101, 102, 103, 104, 105]:
    for j in range(X+1):
        if dp[j] >= 0:
            dp[j] = 1000000
        elif j < val or dp[j - val] <= 0:
            dp[j] = -1
        else:
            dp[j] = dp[j - val] - 1
print(1 if dp[-1] >= 0 else 0)

Submission status: Accepted

Solution code:
X = int(input())
W = 100000 + 1
H = 6
S = [100, 101, 102, 103, 104, 105]

dp = [[-1] * W] * H

for i in range(H):
    for j in range(W):
        if j == S[i]:
            dp[i][j] = 1
        if j - S[i] >= 0 and dp[i][j - S[i]] == 1:
            dp[i][j] = 1
        if i - 1 >= 0 and dp[i - 1][j] == 1:
            dp[i][j] = 1
        if dp[i][j] == 1 and j + S[i] <= 100000:
            dp[i][j + S[i]] = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

dp = [0 for i in range(100)]
for i in range(6):
  dp.append(1)

i = 106

while i <= x+5:
  if dp[i - 100] + dp[i - 101] + dp[i - 102] + dp[i - 103] + \
  dp[i - 104] + dp[i - 105] == 0:
    dp.append(0)
  else:
    dp.append(1)
  i = i + 1
  
print(dp[x])

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    X = int(input())

    goods = (100, 101, 102, 103, 104, 105)
    dp = [float('inf')] * (X + 1)
    dp[0] = 0
    for i in range(X + 1):
        for j in range(6):
            if i - goods[j] >= 0:
                dp[i] = min(dp[i], dp[i - goods[j]] + 1)
    if type(dp[X]) is int:
        print(1)
    else:
        print(0)


main()

Submission status: Accepted

Solution code:
x = int(input())
ls = [100,101,102,103,104,105]
for dv in ls:
    if x%dv == 0:
        print(1)
        exit()
lower = int(x/105)
upper = int(x/100)
if lower == upper:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
X = int(input())
N = X//100
mod100 = X%100
loop= min(N,100)
for a1 in range(loop):
    for a2 in range(loop-a1+1):
        for a3 in range(loop-(a1+a2)+1):
            for a4 in range(loop-(a1+a2+a3)+1):
                for a5 in range(loop-(a1+a2+a3+a4)+1):
                    if a1+2*a2+3*a3+4*a4+5*a5 == mod100:
                        print(1)
                        exit()
print(0)

Submission status: Accepted

Solution code:
X = int(input())

err = 0

if X >= 2000:
    print("1")
    err = 1
else:
    for i in range(19):
        n = i + 1
        if X>= 100*n and X<= 100*n+5*n:
            print("1")
            err = 1
            break
if err == 0:
    print("0")

Submission status: Accepted

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

#整数の入力
X = int(input())

flg = 0

for n in range(1, 1000):
    if 100*n <= X <= 100*n + 5*n:
        flg = 1
    else:
        pass

if flg == 1:
    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())
v = x // 100
modv = x % 100
if v > 0 and (modv == 0 or modv / v <= 5):
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x = input()
xbc  = int(x[-2:])
xa   = int(x[0])
cost = xbc
cnt=0

for i in range(5,-1,-1):
    if((cost // i)>0):
        w = cost //i
        cost -= i*w
        cnt += w
    if(cost==0):
        break
if(int(x)<cnt*100):
    print("0")
else:
    print("1")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
X = int(input())
#100 a + 101 b + 102 c + 103 d + 104e+105f=X
#102.5(a+b+c+d+e+f)+0.5(d-c)+1.5(e-b)+2.5(f-a)=X
#205(a+b+c+d+e+f)+(d-c)+3(e-b)+5(f-a)=2X

#lower
abcdef = int(2 * X // 205)
def1 = 2 * X - 205 * abcdef
f = def1 // 5
de = def1 % 5
e = de // 3
d = de % 3
if f + e + d <= abcdef:
    print(1)
    exit()

#greater
abcdef = math.ceil(2 * X / 205)
abc = 205 * abcdef - 2 * X
a = abc // 5
bc = abc % 5
b = bc // 3
c = bc % 3
if a + b + c <= abcdef:
    print(1)
    exit()

print(0)

Submission status: Accepted

Solution code:
X = int(input())

if X < 100:
    ans = 0
else:
    a = str(X)
    a = int(a[:-2])
    b = X - a*100

    if a >= 20:
        ans = 1

    else:
        if a*5 >= b:
            ans = 1
        else:
            ans = 0

print(ans)

Submission status: Accepted

Solution code:
import math
x = int(input())
if x >=  2000:
    print(1)
elif x <= 99:
    print(0)
else:
    a = math.floor(x / 100)
    b = x % 100
    if b > 5*a:
        print(0)
    else:
        print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
line = input()

if int(line) >= 100:
    num = int(line[-2:])
    item_number = int(line[:-2])



    res_list = []
    a = 5
    while True:
        if num == 0:
            break
        for _ in range(num//a):
            res_list.append(a)

        num = num % a

        if 1<= num <= 4:
            res_list.append(num)
            break


    # print(res_list)

    if len(res_list) > item_number:
        print(0)
    else:
        print(1)

else:
    print(0)

Submission status: Accepted

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

    if any((1 <= X <= 99,
           106 <= X <= 199,
           211 <= X <= 299,
           316 <= X <= 399,
           421 <= X <= 499,
           526 <= X <= 599,
           631 <= X <= 699,
           736 <= X <= 799,
           841 <= X <= 899,
           946 <= X <= 999,
           1051 <= X <= 1099,
           1156 <= X <= 1199,
           1261 <= X <= 1299,
           1366 <= X <= 1399,
           1471 <= X <= 1499,
           1576 <= X <= 1599,
           1681 <= X <= 1699,
           1786 <= X <= 1799,
           1891 <= X <= 1899,
           1996 <= X <= 1999)):
        return '0'
    return '1'

print(c_100_to_105())

Submission status: Accepted

Solution code:
n = int(input())
r = n
left = n//100
n = n%100
pay = 0
chance = 0
for i in range(5, 0,-1):
	pay+=(n//i)
	chance+=(n%i)
	n=n%i
if pay<=left:
	print(1)
else:
	print(0)

Submission status: Accepted

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

if x2==0:
  print('1')
elif X<100:
  print('0')
else:
  tmp=0
  for f in range(19,0,-1):
    if 5*f==x2:
      tmp=105*f
      break
    elif 5*f<x2:
      x2 -= 5*f
      tmp = 105*f + (100 + x2)
      break
      
  if tmp>X:
    print('0')
  else:
    print('1')

Submission status: Accepted

Solution code:
N = int(input())
N1 = N%100//5
N2 = 0
if N%100%5 == 0:
    N2 = 0
else:
    N2 = 1
S =N1+N2
if 100*S > N:
    print("0")
else:
    print("1")

Submission status: Accepted

Solution code:
x = int(input())
l = x // 100
if x >= 2000:
    print(1)
else:
    k = l % 20
    min = l*100
    max = l*100 + k*5
    if min <= x <= max:
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
n = int(input())

s = n % 100
b = (n - s) // 100

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

Submission status: Accepted

Solution code:
#-*- coding: utf-8 -*-
"""
oj dl https://atcoder.jp/contests/abc116/tasks/abc116_d -d test-d
oj test -d test-d -c "python abc116d.py"
oj test -d test-d -c "python abc116d.py" test-d/sample-3.in
"""
from collections import defaultdict
import sys
import math
from datetime import datetime
import re
import math

sys.setrecursionlimit(1000000)
#print (sys.getrecursionlimit())
# def rec(zan, dp):
#     # if zan % 100 == 0 or \
#     #         zan % 101 == 0 or \
#     #         zan % 102 == 0 or \
#     #         zan % 103 == 0 or \
#     #         zan % 104 == 0 or \
#     #         zan % 105 == 0:
#     #     print("zan {}".format(zan))
#     if zan == 0:
#         #print("hogaaaaaaaaaaaaaahhh ! {}".format(zan))
#         return True
#     elif zan < 0:
#         return False
#     else:
#         if zan in dp: return dp[zan]
#         # if zan-100 >= 0:
#         #     a0 = rec(zan-100, dp)
#         #     dp[zan -100] = a0
#         # if zan-101 >= 0:
#         #     a1 = rec(zan-101, dp)
#         #     dp[zan -101] = a1
#         # if zan-102 >= 0:
#         #     a2 = rec(zan-102, dp)
#         #     dp[zan -102] = a2
#         # if zan-103 >= 0:
#         #     a3 = rec(zan-103, dp)
#         #     dp[zan -103] = a3
#         # if zan-104 >= 0:
#         #     a4 = rec(zan-104, dp)
#         #     dp[zan -104] = a4
#         # if zan-105 >= 0:
#         #     a5 = rec(zan-105, dp)
#         #     dp[zan -105] = a5
#
#         a0 = rec(zan-100, dp)
#         dp[zan -100] = a0
#         a1 = rec(zan-101, dp)
#         dp[zan -101] = a1
#         a2 = rec(zan-102, dp)
#         dp[zan -102] = a2
#         a3 = rec(zan-103, dp)
#         dp[zan -103] = a3
#         a4 = rec(zan-104, dp)
#         dp[zan -104] = a4
#         a5 = rec(zan-105, dp)
#         dp[zan -105] = a5
#         #print(a0, a1, a2, a3, a4, a5)
#         ans = any(
#           [a0, a1, a2, a3, a4, a5]
#         )
#         dp[zan] = ans
#         return ans
# def sol(n):
#     dp = [False] * (n+5)
#     rec(n, dp)
#     #print("dp[%s] = %s" % (n, dp[n]))
#     return '1' if dp[n] else '0'


def sol(n):
    dp = [[False] * (n+1) for _ in range(6)]
    P = [
        100, # 100 yen
        101, # 101 yen
        102, # 102 yen
        103, # 103 yen
        104, # 104 yen
        105, # 105 yen
    ]
    for i in range(len(P)):
        for j in range(n+1): # amount
            if j % P[i] == 0:
                dp[i][j] = True
            else:
                candidates = [False]
                if j - P[i] >= 0: candidates.append(dp[i][j-P[i]])
                if i - 1 >= 0: candidates.append(dp[i-1][j])
                dp[i][j] = any(candidates)
    #for row in dp: print(row)
    #print("n {}, len(dp) {}".format(n, len(dp[0])))
    return '1' if dp[5][n] else '0'


do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    n = int(parsed_lines[0][0])
    #k = int(parsed_lines[0][1])
    #S = parsed_lines[0][0]
    return n


if not do_submit:
    S = input_parse("""
    615
    """)
    print(sol(S))

    S = input_parse("""
    217
    """)
    print(sol(S))

else:
    #A, B = list(map(int, input().split()))
    S = int(input())
    print(sol(S))

    # S = input().strip()
    # print(sol(S))

Submission status: Accepted

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

remain = x % 100
quotient = math.floor(x/100)

items = [100, 101, 102, 103, 104, 105]
n = 6

for moneys in itertools.combinations_with_replacement(items, quotient):
    if sum(moneys) == x:
        print(1)
        exit()
print(0)

Submission status: Accepted

Solution code:
import sys

#+++++
		
def main():
	dd=[0]*100200
	a = int(input())
	cc=[100,101,102,103,104,105]
	dd[0]=1
	for i in range(a+1):
		if i == a:
			return dd[i]
		if dd[i] == 1:
			for c in cc:
				dd[i+c] = 1
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
x=int(input())
p=x//100
q=x%100

for i in range(p):
    q-=5
if q<=0:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())

cnt = (X - X % 100) // 100
d2 = X % 100


if d2 % 5 == 0:
    if d2 // 5 <= cnt:
        result = 1
    else:
        result = 0
else:
    if d2 // 5 + 1 <= cnt:
        result = 1
    else:
        result = 0
print(result)

Submission status: Accepted

Solution code:
x = int(input())
amari = x%100
tiket = x//100
ans = 0
i = 0
if amari == 0:
    ans = 1
while (tiket > 0 and i < 5):
#  print(i,amari,tiket)
  tiket -= amari//(5-i)
  amari = amari % (5-i)
  i += 1
  if (amari == 0 and tiket>=0):
    ans = 1
    break
print(ans)

Submission status: Accepted

Solution code:
from math import ceil
N = int(input())
if N < 100:
    print(0)
    exit()
t, s = str(N)[:-2], str(N)[-2:]
if int(t) >= ceil(int(s)/5):
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

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

a = x%100

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

Submission status: Accepted

Solution code:
def main():

    x = int(input())
    x_amari = x%100

    x_100 = x//100
    #print('x_100')
    #print(x_100)

    x_1 = x_amari//1
    x_2 = x_amari//2
    x_3 = x_amari//3
    x_4 = x_amari//4
    x_5 = x_amari//5
    #print('x_5')
    #print(x_5)

    if x_100 >= (x_5+1) or x%105 == 0:
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x=int(input())
m=int(x%100)
n=int(x/100)
c=0
if n<m:
  for i in range(n+1):
    for j in range(n+1-i):
      for k in range(n+1-i-j):
        for s in range(n+1-i-j-k):
          if 1*i+2*j+3*k+4*s+5*(n-i-j-k-s)==m:
            c=1
            break
          
else:
   c=1
    
if c==1:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
import math
import sys


X = int(input())

minkosu = math.ceil(X/105)
maxkosu = math.floor(X/100)

for kosu in range(minkosu, maxkosu+1):
    if(X-100*kosu <= 5*kosu):
        print("1")
        sys.exit()

print("0")

Submission status: Accepted

Solution code:
import sys
x = input()
l = len(x)

if l == 6:
    print(1)
    sys.exit(0)
elif l <= 2:
    print(0)
    sys.exit(0)
else:
    top = int(x[0:l-2])
    left = int(x[l-2:])
    if top * 5 < left:
        print(0)
    else:
        print(1)

Submission status: Accepted

Solution code:
X= int(input())
x=int(X/100)+1


for a in range(x):
    cost0 = 0
    cost0 += 100 * a
    if cost0 > X:
        break
    if cost0 == X:
        print(1)
        exit()

    for b in range(x):
        cost1 = cost0 + 101 * b
        if cost1 > X:
            break
        if cost1 == X:
            print(1)
            exit()

        for c in range(x):
            cost2 = cost1 + 102 * c
            if cost2 > X:
                break
            if cost2 == X:
                print(1)
                exit()

            for d in range(x):
                cost3 = cost2 + 103 * d
                if cost3 > X:
                    break
                if cost3 == X:
                    print(1)
                    exit()

                for e in range(x):
                    cost4 = cost3 + 104 * e
                    if cost4 > X:
                        break
                    if cost4 == X:
                        print(1)
                        exit()

                    for f in range(x):
                        cost5 = cost4 + 105 * f
                        if cost5 > X:
                            break
                        if cost5 == X:
                            print(1)
                            exit()
print(0)

Submission status: Accepted

Solution code:
X = int(input())
divisions_100 = X//100
residuals = X%100
n_100 = 0
for i in range(1,6)[::-1]:
    n_100 += residuals // i
    residuals -= (residuals // i)*i
    if residuals % i == 0:
        break
if n_100 <= divisions_100:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())
capacity = 1000000
# initialize
dp = [0 if i==0 else -1 for i in range(X + 1)]
N = 6
a = [i for i in range(100, 106)]
m = [capacity for i in range(N)]

# DP
for i in range(N):
    dp_tmp = []
    for j in range(X + 1):
        if (dp[j] >= 0):
            dp_next = m[i]
        elif ((j < a[i]) or (dp_tmp[j-a[i]] <= 0)):
            dp_next = -1
        else:
            dp_next = dp_tmp[j-a[i]] - 1
        dp_tmp.append(dp_next)
    dp = dp_tmp

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

Submission status: Accepted

Solution code:
X = int(input())
count = int(X / 100)
left = X % 100

if left == 0:
    print(1)
elif count * 5 < left:
    print(0)
elif count * 5 == left:
    print(1)
elif count * 5 > left:
    print(1)

Submission status: Accepted

Solution code:
X = float(input())
p = int(X/100) #xが何百以上か判別する。
T=1 #TRUE
F=0 #FALSE
if p==0:
 print(F)

else:
 if X<=p*105:
  print(T)
 else:
  print(F)

Submission status: Accepted

Solution code:
X = int(input())
sinamono = [100, 101, 102, 103, 104, 105]
dp = [[False for _ in range(X+100)] for _ in range(len(sinamono)+1)]

dp[0][0] = True

for i in range(len(sinamono)):
    for j in range(X+10):
        if (j < sinamono[i]):
            dp[i + 1][j] = dp[i][j]
        else:
            dp[i + 1][j] = dp[i][j] or dp[i + 1][j - sinamono[i]]

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

Submission status: Accepted

Solution code:
x=int(input())
n=x//100
k=x%100
a=k//10
v=x%10
if v==0:
    b=0
elif v<=5:
    b=1
else:
    b=2
value=a*2+b
if n>=value:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
a = int(input())
l = [int(x) for x in list(str(a))]
n = int(l[(len(l)-2)]*10 + l[(len(l)-1)])
m = int((a - n)/100)

if a < 100:
  print(0)
else:
  while n > 5 and m > 0:
    n = n - 5
    m = m - 1
  if m == 0:
    print(0)
  else:
    print(1)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
X=int(input())

if 103-X%103<=3*((X//105)+1):
    print(1)
elif X%103<=2*X//103:
    print(1)
else:
    print(0)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
MAX = 100000+1
prices = [100, 101, 102, 103, 104, 105]

result = [ 0 for x in range(MAX)]
result[100] = 1
result[101] = 1
result[102] = 1
result[103] = 1
result[104] = 1
result[105] = 1

x = int(input())
for v in range(100, x+1):
    for p in prices:
        if result[v] or result[v-p]:
            result[v] = 1
            break
print(result[x])

Submission status: Accepted

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

N = int(input())
# X, Y = map(int,input().split())
# Z, W = map(int,input().split())
# vA = list(map(int, input().split()))

for x in range(1, N+1):
    if 100.0 <= N/x <= 105.0:
        print(1)
        exit(0)
print(0)

Submission status: Accepted

Solution code:
X = int(input())

sum_list = []
for i in range(1,1000):
    for v in range(100*i,105*i+1):
        sum_list.append(v)
        
if X in sum_list:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
N = int(input())
F = int((N-N%100)/100)
L = N%100

if N > 2000:
    print(1)
elif F * 5 >= L:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x = int(input())
n = x//100 + 1
 
for i in range(n):
  for j in range(n):
     for k in range(n):
         for l in range(n):
             for m in range(n):
                 c = 100*i + 101*j + 102*k + 103*l + 104*m
                 if x >= c:
                    t = x-c
                
                    if t%105 == 0:
                        print(1)
                        exit()
                    
print(0)

Submission status: Accepted

Solution code:
X = input()

simo2 = X[-2:]
ue = X[:-2]

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

if int(simo2)%5 !=0:
    if int(simo2)//5 + 1 <= int(ue):
        print('1')
    else:
        print('0')
else:
    if int(simo2)//5 <= int(ue):
        print('1')
    else:
        print('0')

Submission status: Accepted

Solution code:
x = int(input())

if x >= 4000:
    print(1)
else:
    found = False
    for i0 in range(x // 100 + 1):
        if found:
            break
        for i1 in range(x // 101 + 1):
            if found:
                break
            for i2 in range(x // 102 + 1):
                if found:
                    break
                for i3 in range(x // 103 + 1):
                    if found:
                        break
                    for i4 in range(x // 104 + 1):
                        p = x - (i0 * 100 + i1 * 101 + i2 * 102 + i3 * 103 + i4 * 104)
                        if p >= 0 and p % 105 == 0:
                            print(1)
                            found = True
                            break
    if not found:
        print(0)

Submission status: Accepted

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

X = int(input())

l = []
for i in range(1001):
    l.extend(list(range(i*100, 105*i+1)))


if X in l:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
import numpy as np
x=int(input())
if x<=99:
    print(0)
    exit()
elif x==100 or x==101 or x==102:
    print(1)
    exit()
a=[100,101,102,103,104,105]
m=[1000000]*6
dplist = np.ones((7,x+1))*(-1)
dplist[0,0] = 0
for i in range(6):
    for j in range(x+1):
        if dplist[i,j] >= 0:
            dplist[i+1,j] = m[i]
        elif dplist[i+1,j-a[i]]<= 0:
            dplist[i+1,j] = -1
        elif j - a[i] < 0:
            dplist[i+1,j] = -1
        else:
            dplist[i+1][j] = dplist[i+1,j-a[i]] -1

if dplist[6,x] >= 0:
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
last2 = int(str(X)[-2:])
XX_n = int((X - last2)/100)
n5 = int(last2/5)
n4 = int(last2%5/4)
n3 = int(last2%5%4/3)
n2 = int(last2%5%4%3/2)
n1 = int(last2%5%4%3%2)
if XX_n>=n1+n2+n3+n4+n5:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x = input()

ans = 0

if len(x) < 3:
    ans = 0

elif len(x) < 4:
    tmp1 = int(x[-2] + x[-1])
    tmp2 = int(x[0])
    if tmp2 * 5 >= tmp1:
        ans = 1

else:
    tmp1 = int(x[-2] + x[-1])
    tmp2 = int(x[-4] + x[-3])
    if tmp2 * 5 >= tmp1:
        ans = 1

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

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

X100over = X//100
X10 = X%100

X5 = X10//5
X1to4 = X10%5 !=0

if X5+X1to4 <= X100over:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
n=int(input())

a=n//105
b=n//100

ans=False
for k in range(a,b+1):
    #print(str(k)+"個")
    nokori=n-k*100
    #print(nokori)
    lis=[5,4,3,2,1]
    tukai=0
    for a in lis:
        kau=nokori//a
        tukai+=kau
        nokori-=kau*a
    #print(nokori,tukai)
    if(tukai<=k):
        ans=True

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

Submission status: Accepted

Solution code:
n = int(raw_input())

f = n / 100
m = n % 100

done = False
ans = -1

if f * 5 >= m:
    ans = 1
else:
    ans = 0

print ans

Submission status: Accepted

Solution code:
# coding:utf-8
import math
X = int(input())
c = 0
x2 = X%100
for i in range(100000):
  x = 0
  if x2/5 >= 1 :
    x = math.floor(x2/5)
    x2 -= 5*x
  elif x2 / 4 >= 1 :
    x = math.floor(x2/4)
    x2 -= 4*x
  elif x2 / 3 >= 1 :
    x = math.floor(x2/3)
    x2 -= 3*x
  elif x2 / 2 >= 1 :
    x = math.floor(x2/2)
    x2 -= 2*x
  elif x2 / 1 == 1 :
    x = math.floor(x2/1)
    x2 -= 1*x
  c += x
  if x2 == 0:
    break
if X > c*100:
  print("1")
else :
  print("0")

Submission status: Accepted

Solution code:
x = int(input())

q = int(x/100)
r = x%100

if x >= 2000:
	print(1)
elif r <= q*5:
	print(1)
else:
	print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
ans = 0
r = X%100
cnt = 0

for i in range(5,0,-1):
    cnt += r//i
    r %= i
    if r == 0 and cnt <= X//100:
        ans = 1
        break

print(ans)

Submission status: Accepted

Solution code:
import numpy as np
A = int(input())

if A >= 3000:
    print(1)
else:
    a = [100,101,102,103,104,105]
    N = A//100
    dp = np.array([np.array([0 for i in range(A+1)]) for j in range(N+1)])
    dp[0][0] = 1

    for i in range(N):
        for j in np.where(dp[i] == 1)[0]:
        #for j in range(A+1):
           # if dp[i][j] == 1:
            dp[i+1][j+100:j+106] = 1
    print(dp[N][A])

Submission status: Accepted

Solution code:

X = int(input())

def dfs(i, sum):
  if sum > X:
    return False
  if i==6:
    return sum == X
  val = 100 + i
  for j in range((X-sum)//val + 1):
    if dfs(i+1, sum + val * j):
      return True
  return False

if dfs(0, 0):
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
X = int(input())

ints = [5, 4, 3, 2, 1]
flag = False
if X >= 100:
  two_pieces = X % 100
  other_pieces = (X - two_pieces) / 100
  
  for i in ints:
    num_include = int(two_pieces / i)
    if num_include > 0 and num_include <= other_pieces:
        two_pieces -= i * num_include  
        other_pieces -= num_include
    if two_pieces == 0:
        flag = True
        break
    if other_pieces == 0: 
        break
  
print(int(flag))

Submission status: Accepted

Solution code:
X = int(input())

XX = X%100
A = []
for i in range(20):
  for j in range(25):
    for k in range(100):
      for l in range(50):
        if i*5+j*4+k*3+l*2 <= XX:
          A.append((XX-(i*5+j*4+k*3+l*2),l,k,j,i))
#print(A)
for a,b,c,d,e in A:
  if a*101+b*102+c*103+d*104+e*105 <= X:
    print(1)
    exit()
print(0)

Submission status: Accepted

Solution code:
x = int(input())
has = x // 100
ama = x % 100

cnt = 0
for i in range(5):
    cnt += ama // (5-i)
    ama = ama % (5-i)

if cnt > has:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
x = int(input())
a = 0
i = 0
while a <= x:
  a += 100
  i += 1
a -= 100
i -= 1
y = x - a
if y <= i*5:
  print("1")
else:
  print("0")

Submission status: Accepted

Solution code:
s=str(input())
if int(s) < 100:
    print(0)
else:
    x = int(s[-2:])
    a,b = divmod(x,5)
    k = a + (1 if b else 0)
    if k * 100 <= int(s) - x:
        print(1)
    else:
        print(0)