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:
import sys
import itertools

input = sys.stdin.readline
X = int(input())
#a = [int(i) for i in input().split()] 
#e = [[int(i) for i in input().split()] for i in range(n)] 

maxtimes = int(X/100)+2
price = 0
for i1 in range(0, maxtimes):
    #if i1*100 > X:
        #break
    for i2 in range(0, int(X/101)+2):
        #if i1*100+i2*101 > X:
            #break
        for i3 in range(0, int(X/102)+2):
            #if i1*100+i2*101+i3*102 > X:
                #break
            for i4 in range(0, int(X/103)+2):
                #if i1*100+i2*101+i3*102+i4*103 > X:
                    #break
                for i5 in range(0, int(X/104)+2):
                    #if i1*100+i2*101+i3*102+i4*103+i5+104 > X:
                        #break
                    for i6 in range(0, int(X/105)+2):
                        price = i1*100+i2*101+i3*102+i4*103+i5*104+i6*105
                        #print(i1, i2, i3, i4, i5, i6)
                        if price == X:
                            print(1)
                            exit()
                        elif price > X:
                            break

print(0)

Submission status: Accepted

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

X = int(input())
right = X % 100
count_5 = right // 5
right = right % 5
count_4 = right // 4
right = right % 4
count_3 = right // 3
right = right % 3
count_2 = right // 2
right = right % 2
count_1 = right // 1
right = right % 1

count = count_1 + count_2 + count_3 + count_4 + count_5

left = (X - right) // 100
if left >= count:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x=int(input())
if x<=99:
    print(0)
    exit()
if x<=105:
    print(1)
    exit()
dp=[0]*(x+1)
for i in range(100):
    dp[i]=0
for i in range(100,106):
    dp[i]=1
for i in range(106,x+1):
    if dp[i-100]==1 or dp[i-101]==1 or dp[i-102]==1 or dp[i-103]==1 or dp[i-104]==1 or dp[i-105]==1:
        dp[i]=1
print(dp[-1])

Submission status: Accepted

Solution code:
x = int(input())
# x = 100*a + 101*b + 102c + 103d + 104e + 105f
# x = 100*(a+b+c+d+e+f) + b + 2c + 3d  +4e + 5f
# 100以上はaで操作できる
# 下二桁が（上二桁以上）個の1~5の組み合わせで作れるか
limit = x // 100
n = x % 100
if limit == 0:
  print(0)
  exit()
f = n // 5
n = n - f * 5

e = n // 4
n = n - e * 4

d = n // 3
n = n - d * 3

c = n // 2
n = n - c * 2

b = n
print(int(b + c + d + e + f <= limit))

Submission status: Accepted

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

X = int(input())

n = X // 100
d = X % 100

cnt = 0
if 0 <= d <= 5:
    cnt = 1
elif 6 <= d <= 10:
    cnt = 2
elif 11 <= d <= 15:
    cnt = 3
elif 16 <= d <= 20:
    cnt = 4
elif 21 <= d <= 25:
    cnt = 5
elif 26 <= d <= 30:
    cnt = 6
elif 31 <= d <= 35:
    cnt = 7
elif 36 <= d <= 40:
    cnt = 8
elif 41 <= d <= 45:
    cnt = 9
elif 46 <= d <= 50:
    cnt = 10
elif 51 <= d <= 55:
    cnt = 11
elif 56 <= d <= 60:
    cnt = 12
elif 61 <= d <= 65:
    cnt = 13
elif 66 <= d <= 70:
    cnt = 14
elif 71 <= d <= 75:
    cnt = 15
elif 76 <= d <= 80:
    cnt = 16
elif 81 <= d <= 85:
    cnt = 17
elif 86 <= d <= 90:
    cnt = 18
elif 91 <= d <= 95:
    cnt = 19
elif 96 <= d <= 99:
    cnt = 20


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

Submission status: Accepted

Solution code:
X = int(input())

x = X % 100
n = X // 100

if n > 0:
    while x >= 5 and n != 0:
        x = x - 5
        n = n - 1

    while x >= 4 and n != 0:
        x = x - 4
        n = n - 1

    while x >= 3 and n != 0:
        x = x - 3
        n = n - 1

    while x >= 2 and n != 0:
        x = x - 2
        n = n - 1

    while x >= 1 and n != 0:
        x = x - 1
        n = n - 1

    while x == 0 and n != 0:
        n = n - 1
    
    if n == 0 and x == 0:
        print("1")
    else:
        print("0")


else:
    print("0")

Submission status: Accepted

Solution code:
X = int(input())
for i1 in range(100):
    for i2 in range(10):
        for i3 in range(10):
            for i4 in range(10):
                for i5 in range(10):
                    for i6 in range(10):
                        ans = i1*100+i2*101+i3*102+i4*103+i5*104+i6*105
                        if ans == 0:
                            continue
                        if X%ans == 0:
                            print(1)
                            exit()
print(0)

Submission status: Accepted

Solution code:
def main():
    n = 6
    A = (100, 101, 102, 103, 104, 105)
    M = [10**6]*6
    K = int(input())
    dp = [[-1]*(K+1) for _ in range(n+1)]
    dp[0][0] = 0
    for i in range(n):
        for j in range(K+1):
            if dp[i][j] >= 0:
                dp[i+1][j] = M[i]
            elif j < A[i] or dp[i+1][j-A[i]] <= 0:
                dp[i+1][j] = -1
            else:
                dp[i+1][j] = dp[i+1][j-A[i]] - 1
    if dp[n][K] >= 0:
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())
A = (X%100)//10 #下2桁目
B = X%10 #下一桁目
count = X//100 #回数
if B>5:
    C = 2
elif B:
    C = 1
else:
    C = 0
if X>99 and count >= (A*2)+C:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x = int(input())

y = x // 100
r = x % 100

vs = [5, 4, 3, 2, 1]
t = 0
for i in range(5):
    n = r // vs[i]
    r -= n * vs[i]
    t += n
    if r == 0:
        break
if t <= y:
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
d, r = divmod(x, 100)
print(int((r + 4) // 5 <= d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

k = x//100
r = x%100

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
def MAP(): return [int(s) for s in input().split()]

if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline

N = int(input())

total = int(N//100)
print(1 if total*5 >= N%100 else 0)

Submission status: Accepted

Solution code:
import sys
from math import factorial
from fractions import Fraction
import heapq, bisect
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7

x = INT()
up = x//100
down = x%100

count5 = down//5
if down %5 == 0:
    count5 -= 1
if count5+1 <= up:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())

ans = 1
i = 5

N = X // 100
res = X % 100

while ans:
    if res // i > N:
        ans = 0
    else:
        N -= res // i
        res = res % i
    i -= 1
    if i == 0:
        break


print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

l = int(m/5)
k = int(n/100)

if n%105 == 0:
    print(1)
else:
    if l+1 <= k:
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
#!/usr/bin/env pytho3
import math
s = int(input())

if s < 2000:
    d = s//100
    if s - d*105 > 0:print(0)
    else:print(1)
else: print(1)

Submission status: Accepted

Solution code:
x = int(input())

y = x//100

xx = x-y*100



for _ in range(y):
    if xx >= 5:
        xx -= 5
    elif xx >= 4:
        xx -= 4
    elif xx >= 3:
        xx-=3
    elif xx>=2:
        xx-=2
    elif xx >= 1:
        xx-=1
    else:
        xx=xx


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

Submission status: Accepted

Solution code:
import math
N = input()
A = [100, 101, 102, 103, 104, 105]
if len(str(N))  <= 2:
  print(0)
  quit()
last = int(N[-2] + N[-1])
head = int(N[0:-2])
if 105 * head >= int(N):
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
n=int(input())
k=n//100
a=0
for i in range(k+1):
    if 0<=n-i*100<=5*i:
        a=1
        break
print(a)

Submission status: Accepted

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

c = b // 5
d = b % 5

if a > c:
  print(1)
elif a == c and d == 0:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
from itertools import combinations_with_replacement

X = list(input())
tmp = X
num = int("".join(tmp))

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

X.pop()
X.pop()
X = int("".join(X))

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

for i in combinations_with_replacement(food, X):
    if sum(i) == num:
        print(1)
        exit()

print(0)

Submission status: Accepted

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

    X_div_100 = X // 100
    res_X_div_100 = X % 100

    count = 0

    while True:
        if res_X_div_100 >= 5:
            res_X_div_100 -= 5
            count += 1
        elif res_X_div_100 >= 4:
            res_X_div_100 -= 4
            count += 1
        elif res_X_div_100 >= 3:
            res_X_div_100 -= 3
            count += 1
        elif res_X_div_100 >= 2:
            res_X_div_100 -= 2
            count += 1
        elif res_X_div_100 >= 1:
            res_X_div_100 -= 1
            count += 1
        else:
            break

    if count <= X_div_100:
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    x  = int(input())
    tmp = (x - (x % 100)) / 100
    if tmp * 100 <= x and x <= tmp * 105:
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X=int(input())
a=100
b=105
for n in range (0,21):
    if n*b<X<(n+1)*a:
        print("0")
        break
    else:
        n+=1
else:
    print("1")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    x = input()
    two = int(x[-3:])
    max_count = int(x[:-3] or 0)
    count = 0
    for i in range(5, 0, -1):
        q, two = divmod(two, i)
        count += q
    print(int(count <= max_count))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
X=int(input())

#まとめ　100で割った末尾
#01~05：100より大きければOK
#06~10：100代のみ不可
#11~15：100・200代のみ不可
#…

x=int(X//100)
P=int(((X%100)-1)//5)
if X%100==0:
	print(1)
elif x>P:
	print(1)
else:
	print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a = int(input())
s = str(a)
b = a % 1000
d = a % 100
u = math.floor(a/100)
if 5 * u < d :
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
import itertools

def main():
  X = int(input())
  S = int(X/100)
  
  costs = [100, 101, 102, 103, 104, 105]
  
  for v in itertools.combinations_with_replacement(costs, S):
    if sum(v) == X:
      return 1
  
  return 0

print(main())

Submission status: Accepted

Solution code:
n = int(input())
kumi = n % 100
kosuu = n//100
for i in range(1000):
  if 105*i >= n:
    if 100*i <= n:
      print('1')
    else:
      print('0')
    break

Submission status: Accepted

Solution code:
import sys, math
from collections import defaultdict
from copy import deepcopy
import itertools
input = sys.stdin.readline
# 文字列の場合は普通のinput()を使うか下を使う
# input = sys.stdin.readline().rstrip()

X = int(input())
x = X % 100
#print('x={}'.format(x))
A = [0] * 6
for i in range(5, 0, -1):
    A[i] = x // i
    x -= A[i] * i

#print('A={}'.format(A))

n = 0
for i, a in enumerate(A):
    n += i * a
v = sum(A)

if (X - n) % 100 != 0 or (X - n) // 100 < v:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
X = int(input())

if X < 100 or X % 100 > (X // 100) * 5:
  print(0)
else:
  print(1)

Submission status: Accepted

Solution code:
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby


x = int(stdin.readline().rstrip())
num = int(x / 100)
if x < 100:
    print(0)
elif x <= num * 105 and x >= num*100:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())

f = X // 100
dis_min = 100 * f
dis_max = 105 * f

if dis_min <= X <= dis_max:
    print("1")
else:
    print("0")

Submission status: Accepted

Solution code:
import math

n = int(input())
n1 =  str(n)

if n /100 >= 20:
    print("1")
elif n < 100:
    print("0")
elif math.ceil(int(n1[-2] + n1[-1]) / 5) <= math.floor(n / 100):
    print("1")
else:
    print("0")

Submission status: Accepted

Solution code:
x = int(input())

if x % 100 == 0:
    print(1)
    exit()

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

num = x // 100
diff = x % 100

for i in range(num+1):
    for j in range(num - i+1):
        for k in range(num - i - j+1):
            for l in range(num - i - j - k+1):
                for m in range(num - i - j - k - l+1):
                    ans = 1 * i + 2 * j + 3 * k + 4 * l + 5 * m
                    if ans == diff:
                        print(1)
                        exit()

print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
buy=[0]*10**6
buy[0]=1
def write(n):
  if buy[n-105] or buy[n-104] or buy[n-103] or buy[n-102] or buy[n-101] or buy[n-100]:
    buy[n]=1
for i in range(10**5+1):
  write(i)
print(buy[x])

Submission status: Accepted

Solution code:
x = int(input())

item_count = x // 100
amari = x % 100

for i in range(item_count):
  for j in range(5, 0, -1):
    if amari - j >= 0:
      amari -= j
      break
  if amari == 0:
    break
if amari == 0:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
n=input()
if len(n)==1:
  a=10
else:
  a=n[-2]+n[-1]
if a=="00":
  c=0
else:
  c=int(a)
b=int(n)//100
if b*5<c:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
import sys
X = int(input())
 
size    = [100, 101, 102, 103, 104, 105]
value   = [100, 101, 102, 103, 104, 105]
N       = len(size)
MAX_N   = 1000000
 

knapsack_size = X
if knapsack_size >= MAX_N:
    sys.exit(1)
total   = [0 for _ in range(MAX_N)]
choice  = [-1 for _ in range(MAX_N)]
for i in range(N):
    for j in range(size[i], knapsack_size+1):
        repack_total = total[j-size[i]] + value[i]
        if repack_total > total[j]:
            total[j] = repack_total
            choice[j] = i
i = knapsack_size
while choice[i] >= 0:
    i -= size[choice[i]]
if X == total[knapsack_size]:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())
std = X // 100
#print(std)
if std * 100 <= X and X <= std * 100 + std * 5:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
x=int(input())
 
if x<100:
	print("0")
	exit()
 
while 1:
	tm=(str(x)[-2:])
	if int(tm) > 5:
		x-=105
	else:
		print("1")
		exit()
 
	if x<100:
		print("0")
		exit()

Submission status: Accepted

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

if cheak_x*100 <= x and x <= cheak_x*105 :
    print (1)

else :
    print (0)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def solve():
    X = int(input())
    L = [0 for _ in range(X+1)]
    L[0] = 1
    for a in range(100, 106):
        for b in range(a, X+1):
            L[b] = L[b-a] or L[b]
    return str(L[-1])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
dp = [None] * 1000001
for i in range(100):
    dp[i] = False
dp[100] = True
dp[101] = True
dp[102] = True
dp[103] = True
dp[104] = True
dp[105] = 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
    else:
        dp[i] = False

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

Submission status: Accepted

Solution code:
#C
N=int(input())
p=N//100#全部100円の商品を買った場合の買える個数
q=N//105#全部105円
hantei =False
for i in range(q,p+2):#i個の商品を買った上下一円単位は全て埋められる。
  if i*100<=N<=i*105:
    hantei = True
print('1' if hantei else '0')

Submission status: Accepted

Solution code:
from fractions import gcd
# from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
import sys
from bisect import *
import itertools
import copy
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7


def main():
    x = int(input())
    c = x //100
    v = x % 100
    #print(c, v)
    if v <= c * 5 and v >= 0:
        print(1)
    else:
        print(0)



    


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from functools import reduce

def judge(S):
    if int(S) < 100:
        print(0)
        return

    kingaku = [int(x) for x in list(S)]
    maxkosuul = kingaku[:-2]
    keta = kingaku[-2:]
    maxkosuu = int(reduce(lambda x, y: x + y, [str(x) for x in maxkosuul]))
    simo = int(reduce(lambda x, y: x + y, [str(x) for x in keta]))
    simo1 = simo - simo//5*5
    simo2 = simo1 - simo1//4*4
    simo3 = simo2 - simo2//3*3
    simo4 = simo3 - simo3//2*2
    if simo//5+simo1//4+simo2//3+simo3//2+simo4 <= maxkosuu :
        print(1)
    else:
        print(0)

S = input()
judge(S)

Submission status: Accepted

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

    max_onigiri = x // 100
    mod100 = x % 100
    onigiri = mod100 // 5
    if mod100 % 5 != 0:
        onigiri += 1
    print(1 if onigiri <= max_onigiri else 0)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

X=input()

C={}    #n円を構成する品物の最小個数の集合

for n in range(100):
    org_n=copy.deepcopy(n)
    kosu=0     #n円を構成する品物の最小個数
    for i in range(5,0,-1):     
        kosu+=n/i
        n=n%i   #iで割った余りが残る
        if n==0:
            C[org_n]=kosu
            break

max_kosu=X/100
x=X%100

if max_kosu>=C[x]:
    print 1
else:
    print 0

Submission status: Accepted

Solution code:
def solve():
    x = int(input())
    s = str(x)
    if x < 100:
        return print(0)
    s2s = ''.join(([s[-2],s[-1]]))
    s2 = int(s2s)
    # print(s2)

    x1 = s2 // 5
    # print(x1)
    if s2 % 5 == 0:
        n = x1
    else:
        n = x1+1
    # print(n)
    if 100*n > x:
        print(0)
    else:
        print(1)
solve()

Submission status: Accepted

Solution code:
import itertools
l = [0, 1,2,3,4,5]
X = int(input())

flag = False
d = X//100
if (X - 100*d) <= 5*d:
  for c  in itertools.combinations_with_replacement(l, d):
    if sum(c) == X - 100*d:
      print(1)
      flag = True
      break

if not flag:
  print(0)

Submission status: Accepted

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

if((X-s*100)<=5*s):
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x = int(input())
ans = 0
a = 0
n = x//100
for i in range(n):
  a = x - n*100
if n!=0 and a<=5*n:
  ans = 1
print(ans)

Submission status: Accepted

Solution code:
import sys
X = int(input())

for i in range(1, 10 ** 3 + 10):
    if 100*i <= X <= 105*i:
        print("1")
        sys.exit()
print("0")

Submission status: Accepted

Solution code:
n=int(input())
#下２桁を実現させる最小個数を考えよう
l=[0]
for i in range(1,100):
  num=i
  l.append((num-1)//5+1)
w=str(n)
if n<100:
  print(0)
else:
  num=int(w[-2]+w[-1])
  index=l[num]
  if n<index*100+num:
    print(0)
  else:
    print(1)

Submission status: Accepted

Solution code:
def solve():
  n = int(input())
  count = n//100
  rem = n%100
  if n < 100:
    return False
  if rem == 0:
    return True
  ll = 0
  for i in range(5,0,-1):
    q,r = shakutori(rem,i)
    if q != 0:
      ll += q
      rem = r
  if ll <= count:
    return True
  else:
    return False

def shakutori(n,i):
  return n//i,n%i

if __name__ == '__main__':
  print(int(solve()))

Submission status: Accepted

Solution code:
import math

X = int(input())
max_ko = math.floor(X/100)
if(float.is_integer(X/105)):
    min_ko = math.floor(X/105)
else:
    min_ko = math.floor(X/105)+1

for kosu in range(min_ko, max_ko+1):
    big_val = 100*kosu
    max_small_val = 5*kosu
    mokuhyou = X - big_val
    if(mokuhyou >= 0 and mokuhyou <= max_small_val):
        print(1)
        exit()
print(0)

Submission status: Accepted

Solution code:
X = input().rjust(6,"0")

k = 0
shimo2 = int(X[-2] + X[-1])



for i in range(20):
    if 5*(i+1)<shimo2:
        k = i+2
        continue
    else:
        break

if int(X)<=99:
    print("0")
elif k <= int(X[0:4]):
    print("1")
else:
    print("0")

Submission status: Accepted

Solution code:
M = 100001
dp = {}
dp[100],dp[101],dp[102],dp[103],dp[104],dp[105] = 1,1,1,1,1,1
def isComb(dp,n):
	for i in range(100,106):
		for j in range(i,106):
			if n-i in dp and n-j in dp and dp[n-i]==1 and dp[n-j]==1:
				return 1
			
	return 0


for i in range(106,M):
	if isComb(dp,i):
		dp[i] = 1
	else:
		dp[i] = 0
n = int(input())
if n in dp:
	print(dp[n])
else:
	print(0)
# print(dp[n])

Submission status: Accepted

Solution code:
x=int(input())

if x >= 2100:
  print(int(1))
elif x <99:
  print(int(0))
else:
  if 105*(x//100)-x>=0:
    print(int(1))
  else:
    print(int(0))

Submission status: Accepted

Solution code:
import sys

import numpy as np


def main():
    X = int(input())
    V = (100, 101, 102, 103, 104, 105)
    m1 = X // 100
    if m1 == 0:
        print(0)
        sys.exit()
    dp = np.full([(m1 + 1) * 105], 10**9, np.int32)
    dp[0] = 0
    for j in range(1, m1 + 1):
        for v in V:
            w = v * j
            p_dp = dp.copy()
            np.minimum(dp[w:], p_dp[:-w] + w, out=dp[w:])

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


main()

Submission status: Accepted

Solution code:
X=int(input())

k=X//100
r=X%100
if r==0:
    print(str(1))
elif 5*k<r:
    print(str(0))
else:
    print(str(1))

Submission status: Accepted

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

_x = int(input())


def chker(x):
    lower = x / 105
    upper = x / 100

    if lower.is_integer() or upper.is_integer():
        print(1)
    else:
        if int(lower) == int(upper):
            print(0)
        else:
            print(1)


chker(_x)

Submission status: Accepted

Solution code:
N=int(input())

if (N % 100 > 25 and N < 525):
    print("0")
    exit()
tmp1 = N % 100
tmp2 = int(N / 100)
if (tmp1 / 5 != 0):
    tmp3 = int(tmp1 / 5)
    tmp1 = tmp1 % 5
    tmp2 = tmp2 - tmp3
if (tmp1 / 4 != 0):
    tmp3 = int(tmp1 / 4)
    tmp1 = tmp1 % 4
    tmp2 = tmp2 - tmp3
if (tmp1 / 3 != 0):
    tmp3 = int(tmp1 / 3)
    tmp1 = tmp1 % 3
    tmp2 = tmp2 - tmp3
if (tmp1 / 2 != 0):
    tmp3 = int(tmp1 / 2)
    tmp1 = tmp1 % 2
    tmp2 = tmp2 - tmp3
if (tmp1 != 0):
    tmp2 = tmp2 - tmp1
    tmp1 = 0
if (tmp2 < 0):
    print("0")
else:
    print("1")

Submission status: Accepted

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

availableBuyCount = n // 100
surplus = (n % 100)
if surplus % 5 ==0:
    surplus = surplus//5
else:
    surplus = surplus//5 +1

if availableBuyCount < surplus:
    print(0)
else:
    print(1)

Submission status: Accepted

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

x = int(input())

s = str(x)

if x<100:
    print(0)
    exit()
elif x>2000:
    print(1)
    exit()
else:
    if x>=1000:
        d = int(s[-4]+s[-3])
        # print(d)
        e = int(s[-2]+s[-1])
        # print(e)
        if d*5 >= e:
            print(1)
            exit()
        else:
            print(0)
            exit()
    else:
        d = int(s[-3])
        # print(d)
        e = int(s[-2]+s[-1])
        # print(e)
        if d*5 >= e:
            print(1)
            exit()
        else:
            print(0)
            exit()

Submission status: Accepted

Solution code:
X = int(input())

item_list = [100, 101, 102, 103, 104, 105]
# dp[i]: i円支払う払うことができるなら1
dp = [0 for _ in range(100001)]
dp[0] = 1

for item in item_list:
    for i in range(100001):
        if dp[i] == 1 and i + item <= 100000:
            dp[i+item] = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import queue
import bisect
import heapq
import time
import itertools

mod = 1e9+7

def swap(a,b):
    return (b,a)

def gcd(a,b): #最大公約数
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): #素数判定
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): #素数列挙
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def main():
    x = int(input())
    if x<100:
        print(0)
        return
    buy = x//100
    sur = x%100
    num = (sur+4)//5
    if num<=buy:
        print(1)
    else:
        print(0)
    return

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
x = int(input())
if x < 100:
    print(0)
else:
    n = x // 100
    k = x % 100
    t = k // 5
    if t > n or (t == n and k % 5 > 0):
        print(0)
    else:
        print(1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(X: int):
    dp = [False] * 110000
    
    dp[0] = True
    for i in range(100001):
        if dp[i]:
            for j in range(6):
                dp[i+100+j] = True

    print(1 if dp[X] else 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:
X = int(input())
a = X // 100        ##1 <= a <= 1000
X_down = X - 105 * a
if X_down > 0:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

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

N=one_int()

num=int(N/100) 

amari = N%100

def dfs(now, count, max_count):
    if count==max_count:
        if now+(100*max_count) == N:
            return 1
        else:
            return 0
    else:
        ret=[]
        for i in range(6):
            if (max_count-count-1)*5 + i<N:
                dfs(now+i, count+1, max_count ) 
        return ret

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

Submission status: Accepted

Solution code:
X = int(input())

m = X%100
if m==0:
    print(1)
else:
    a = (m-1)//5
    if X>100*(a+1):
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
X = int(input())

x = X % 100
count = X // 100

for i in range(count):
    if x >= 5:
        x -= 5
    else:
        x = 0

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

Submission status: Accepted

Solution code:
X = int(input())
X2 = int(str(X)[-2:])

num = 0
for i in range(5, 0, -1):
    q, X2 = divmod(X2, i)
    if q == 0: continue
    num += q
    if X2 == 0: break
    
if X >= num*100: print(1)
else: print(0)

Submission status: Accepted

Solution code:
X = int(input())

if X < 100:
    print(0)
else:
    y = X - X // 100 * 100

    if y // (X // 100) < 5:
        print(1)
    elif y // (X // 100) == 5 and y % (X // 100) == 0:
        print(1)
    else:
        print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    x = int(input())
    q = x // 100
    r = x % 100
    if r == 0 :
        print("1")
        return None
    if r % 5 == 0:
        y = r//5
    else:
        y = (r //5)+ 1
    if q < y:
        print("0")
    else:
        print("1")
resolve()

Submission status: Accepted

Solution code:
x = int(input())

q = x // 100
r = x % 100

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

Submission status: Accepted

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

if X-100*N>5*N :
	print(0)
else :
	print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
c=0
for i in range(1,20):
    if 100*i<=x<=105*i:c=1
if 1999<x:c=1
print(c)

Submission status: Accepted

Solution code:
x=input()

if len(x)>=3:
  if int(x[-2:])%5==0:
    if int(x[:-2])-int(x[-2:])//5>=0:
      print(1)
    else:
      print(0)
  elif int(x[-2:])%4==0:
    if int(x[:-2])-int(x[-2:])//4>=0:
      print(1)
    else:
      print(0)
  elif int(x[-2:])%3==0:
    if int(x[:-2])-int(x[-2:])//3>=0:
      print(1)
    else:
      print(0)
  elif int(x[-2:])%2==0:
    if int(x[:-2])-int(x[-2:])//2>=0:
      print(1)
    else:
      print(0)
  elif int(x[-2:])%1==0:
    if int(x[:-2])-int(x[-2:])//1>=0:
      print(1)
    else:
      print(0)
  else:
    print(0)
else:
  print(0)