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 time
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    X = int(readline())
    top = X //100
    bottom = (X%100+4)//5
    if top>=bottom:
        print(1)
    else:
        print(0)

if __name__ == '__main__':
    main()

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np

X = int(input())

dp = np.zeros(X + 1)

if X >= 105:
    dp[100] = dp[101] = dp[102] = dp[103] = dp[104] = dp[105] = 1
elif X >= 104:
    dp[100] = dp[101] = dp[102] = dp[103] = dp[104] = 1
elif X >= 103:
    dp[100] = dp[101] = dp[102] = dp[103] = 1
elif X >= 102:
    dp[100] = dp[101] = dp[102] = 1
elif X >= 101:
    dp[100] = dp[101] = 1
elif X >= 100:
    dp[100] = 1


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] = 1

print(int(dp[X]))

Submission status: Accepted

Solution code:
x = int(input())
n = x // 100
r = x % 100
# a_1 + a_2 + ... + a_n = 100n + r
print('1' if r <= 5 * n else '0')

Submission status: Accepted

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

N=int(math.ceil(X/105))
dekiruka=0
while N <= X/100:
    if X-100*N <= 5*N:
        dekiruka=1
        break
    N=N+1

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

Submission status: Accepted

Solution code:
import sys
x = input()
x1 = list(x)
h = len(x)
x = int(x)

if x>2000:
  print('1')
  sys.exit()

a1 = int(x1[h-1])
a2 = int(x1[h-2])

if 0 < a1 <= 5:
  c1 = 1
elif a1 == 0:
  c1 = 0
else:
  c1 = 2

c2 = a2*2
#print(x1[0],x1[1])
if h>3:
  if 10*int(x1[0])+int(x1[1]) < c1+c2:
    print('0')
  else:
    print('1')
else:
  if int(x1[0]) < c1+c2:
    print('0')
  else:
    print('1')

Submission status: Accepted

Solution code:
x=int(input())

num = x//100
div = x%100
ans=0

if  0<=div<=(num*5):
    ans=1

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# bsumitb2019_c.py
X = int(input())
head = X//100
tail = X%100
if tail >head*5:
    print(0)
else :
    print(1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

num_min = x//105
num_max = x//100

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

Submission status: Accepted

Solution code:
x = int(input())

possible = [0] * (x+1) # array of x+1 zeroes
possible[0] = 1

for k in range(x+1):
    for i in range(100, 106):
        if k-i >= 0 and possible[k-i]:
            possible[k] = 1

print(possible[x])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
key = [False]*(pow(10, 5)+1)
for i in range(1, 1000):
  for j in range(100*i, 105*i+1):
    if j <= pow(10, 5):
      key[j] = True
print(1 if key[x] else 0)

Submission status: Accepted

Solution code:
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
from collections import deque,Counter
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
X = int(input())

dp = {100:1,101:1,102:1,103:1,104:1,105:1}
lis = [100,101,102,103,104,105]
que = deque([100,101,102,103,104,105])
while len(que)>0:
    num = que.popleft()
    for i in lis:
        dp[num+i] = 1
        if num+i <= 100000 and not(num+i in que):
            que.append(num + i)

if X in dp:
    ans = 1
else:
    ans = 0

print(ans)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
dp = [0] * (X + 1000)
dp[0] = 1
array = [100, 101, 102, 103, 104, 105]

for x in range(X):
    for y in array:
        if dp[x] == 1:
            dp[x + y] = 1
print(dp[X])

Submission status: Accepted

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

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()

a=n//100

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

flag = False
for c in range(1,x+1):
  if c * 100 <= x and x <= c * 105:
    flag = True
    break
print(1 if flag else 0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

p, q = divmod(x, 100)

ans = 0
if p * 5 >= q:
    ans = 1

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

count = X // 100
amari = X % 100

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

Submission status: Accepted

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt, ceil
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# 2数の最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

# リストの要素の最小公倍数
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

# リストの要素の最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

# 素数判定
def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True


# limit以下の素数を列挙
def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

# 同じものを含む順列
def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        # set（集合）型で重複を削除、ソート
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret


# ここから書き始める
def main(x):
    dp = [0] * x
    for i in range(x):
        if i + 1 in [100, 101, 102, 103, 104, 105]:
            dp[i] = 1
            continue
        if 0 <= i - 105:
            dp[i] = max(dp[i], dp[i - 105])
        if 0 <= i - 104:
            dp[i] = max(dp[i], dp[i - 104])
        if 0 <= i - 103:
            dp[i] = max(dp[i], dp[i - 103])
        if 0 <= i - 102:
            dp[i] = max(dp[i], dp[i - 102])
        if 0 <= i - 101:
            dp[i] = max(dp[i], dp[i - 101])
        if 0 <= i - 100:
            dp[i] = max(dp[i], dp[i - 100])
    return dp[x - 1]


x = int(input())
print(main(x))

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    for i in range(1001):
        if 100*i<=n and n<=105*i:
            print(1)
            break
    else:print(0)


if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
dp = {100: 1, 101: 1, 102: 1, 103: 1, 104: 1, 105: 1}
l = [100, 101, 102, 103, 104, 105]
for i in range(100001):
  if i == 0:
    dp[0] = 1
  elif i < 100:
    dp[i] = 0
  elif i >= 106:
    dp[i] = 0
    for cost in l:
      dp[i] += dp[i-cost]

n = int(input())
if dp[n] >= 1:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
x = int(input())

dp = [0 for _ in range(100000 + 1)] #0:"No", 1:"Yes"
dp[0] = 1
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:
    if sum(dp[i-105:i-99]) >= 1:
        dp[i] = 1
print(dp[x])

Submission status: Accepted

Solution code:
x = int(input())

dp = [0 for _ in range(100000 + 1)] #0:"No", 1:"Yes"
dp[0] = 1
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[x])

Submission status: Accepted

Solution code:
x = int(input())

dp = [0 for _ in range(x + 1)] #0:"No", 1:"Yes"
dp[0] = 1
if x < 100:
    print(dp[x])
    exit()
for i in range(100, min(x+1,106)):
    dp[i] = 1
if x < 106:
    print(dp[x])
    exit()
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[x])

Submission status: Accepted

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

for i in range(N+1):
  if dp[i]:
    for j in range(100, 105+1):
      if i+j <= N:
        dp[i+j] = 1

print(dp[N])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
x = int(input())

tmp1 = (x % 100) // 5
tmp2 = ((x % 100) - tmp1 * 5) // 4
tmp3 = ((x % 100) - tmp1 * 5 - tmp2 * 4) // 3
tmp4 = ((x % 100) - tmp1 * 5 - tmp2 * 4 - tmp3 * 3) // 2
tmp5 = (x % 100) - tmp1 * 5 - tmp2 * 4 - tmp3 * 3 - tmp4 * 2
if x // 100 >= tmp1 + tmp2 + tmp3 + tmp4 + tmp5:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = True

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

    def main():
        X=int(input())
        N=-(-X//100)

        for i in range(1,N+1):
            if 100*i<=X<=105*i:
                return 1
        return 0
    print(main())

resolve()

Submission status: Accepted

Solution code:
import itertools
def modelAnswer(X:int):
   lis = [i for i in range(100,106)]
   C = X//100
   for p in itertools.combinations_with_replacement(lis,C):
      if(sum(p)==X):
         return 1
   return 0

def main():
   X = int(input())
   print(modelAnswer(X))

if __name__ == '__main__':
   main()

Submission status: Accepted

Solution code:
def myAnswer(X:int)-> int:
   # 100より下なら0
   if(X < 100) : return 0

   total = 0 #合計金額
   first = X % 10 #1桁目の数値
   secand = ((X // 10) % 10) *10 #2桁目の数値
   if(first <=5 and first >=1): # １桁目が0以上5以下なら1個で済む
      total += 100 + first
   elif(first >= 6):
      total += 200 + first #1桁目が6以上なら2個必要

   total += (secand//5)*105 # 2桁目は105円から作る
   # Xがtotal以上なら合計金額がちょうどになる。
   return 1 if(total <= X) else 0



def modelAnswer():
   tmp=1
def main():
   X = int(input())
   print(myAnswer(X))

if __name__ == '__main__':
   main()

Submission status: Accepted

Solution code:
X=int(input())
A=X%100
B1=A//5
B2=A%5
C1=B2//4
C2=B2%4
D1=C2//3
D2=C2%3
E=D2//2
F=D2%2
ans=105*B1+104*C1+103*D1+102*E+101*F
if ans<=X:
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from heapq import *
import sys
from collections import *

from itertools import *
from decimal import *
import copy
from bisect import *
import time

import math

def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
sys.setrecursionlimit(10**7)
input=lambda :sys.stdin.readline().rstrip()
X=int(input())
dp=[0]*(X+1)
dp[0]=1
for a in [100,101,102,103,104,105]:
    for i in range(len(dp)):
        if i-a>=0:
            if dp[i-a]==1:
                dp[i]=1
print(dp[-1])

Submission status: Accepted

Solution code:
import math
X=int(input())
under = math.floor(X / 105)
top = math.floor(X/100)
#print("under,top = {},{}".format(under,top))
if X / 105==under or X/100==top or  top - under > 0:
#if top - under > 0:
    print("1")
else:
    print("0")
#for i in range(under, top + 1):

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

r = X % 100

b = r // 5
r -= 5 * b

c = r // 4
r -= 4 * c

d = r // 3
r -= 3 * d

e = r // 2
r -= 2 * e

f = r // 1
r -= 1 * f

if 105 * b + 104 * c + 103 * d + 102 * e + 101 * f > X:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
X = int(input())
flag = 0
for C in range(X+1):
  if 100*C <= X and 105*C >= X:
    flag += 1
    break
print(flag)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())

err = 0
while X >= 0:
    X -= 100
    err += 5
    #print(X, err)
    if 0 <= X <= err:
        print('1')
        break
else:
    print('0')

Submission status: Accepted

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

if x <= 105*n:
    print("1")
else:
    print("0")

Submission status: Accepted

Solution code:
X = int(input())

c = X // 100
d = X - 100 * c

for _ in range(c):
    if (d == 0):
        break
    elif (d >= 5):
        d -= 5
    else:
        d -= d

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

Submission status: Accepted

Solution code:
x = int(input())
dp = [0]*10**6
dp[0] = 1
for i in range(10**5+1000):
    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())
flag = False

for i in range(1,2000):
    if i * 100 <= x <= i * 105:
        flag = True
        break

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

Submission status: Accepted

Solution code:
x = int(input())
MIN = 100
MAX = 105
for k in range(1, 1001):
  if k * MIN <= x <= k * MAX:
    print(1)
    break
else:
  print(0)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import  *

input = int(input())

def getMoney(money):
    prices = [100, 101, 102, 103, 104, 105]
    rem = []
    for element in prices:
        rem.append(money - money * floor(money/element))
    bounds = [floor(money/element) + 1 for element in prices]
    for index1 in range(bounds[0]):
        for index2 in range(bounds[1]):
            for index3 in range(bounds[2]):
                for index4 in range(bounds[3]):
                    for index5 in range(bounds[4]):
                        for index6 in range(bounds[5]):
                            if (index1 * prices[0] + index2 * prices[1] +index3 * prices[2] + index4 * prices[3] + index5 * prices[4] + index6 * prices[5] == money):
                                return 1
    return 0

def getmoneyFast(money):
    prices = [105, 104, 103, 102, 101, 100]
    initialBounds = [floor(money/element) + 1 for element in prices]
    for index1 in range(initialBounds[0]):
        nmoney = money - index1 * prices[0]
        for index2 in range(getNewBound(nmoney,1)):
            nmoney = money - index1 * prices[0] - index2*prices[1]
            for index3 in range(getNewBound(nmoney, 2)):
                nmoney = money - index1 * prices[0] - index2*prices[1] - index3 * prices[2]
                for index4 in range(getNewBound(nmoney, 3)):
                    nmoney = money - index1 * prices[0] - index2*prices[1] - index3 * prices[2] - index4 * prices[3]
                    for index5 in range(getNewBound(nmoney, 4)):
                        nmoney = money - index1 * prices[0] - index2*prices[1] - index3 * prices[2] - index4 * prices[3] - index5 * prices[4]
                        index6 = ((money - (index1 * prices[0] + index2 * prices[1] + index3 * prices[2] + index4 * prices[3] + index5 * prices[4]))/prices[5])
                        if (index6.is_integer()):
                            if (money - index1 * prices[0] - index2*prices[1] - index3 * prices[2] - index4 * prices[3] - index5 * prices[4] - index6*prices[5] == 0):
                                return 1
    return 0



def getNewBound(nmoney, index):
    prices = [105, 104, 103, 102, 101, 100]
    return floor(nmoney/prices[index])+1


print(getmoneyFast(input))

Submission status: Accepted

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

minbuy = 0
for i in range(1,6)[::-1]:
    minbuy += mod // i
    mod = mod % i
print(0 if minbuy*100 > x else 1)

Submission status: Accepted

Solution code:
X = int(input())
a = X % 100
n = X // 100 #買う商品の数
print(1 if a <= 5 * n else 0)

Submission status: Accepted

Solution code:
X = int(input())
dp = [0] * (X+1000)
for i in range(6):
    dp[100+i] = 1
for i in range(X+10):
    for k in range(6):
        if i - 100 - k > 0:
            dp[i] = dp[i] | dp[i-100-k]
print(dp[X])

Submission status: Accepted

Solution code:
d={}
def s(x):
  if 100<=x<=105 or x>=2000:
    return True
  if x<100:
    return False
  if x not in d:
    d[x]=any(s(x-i) for i in range(100,106))
  return d[x]

x=int(input())
print(int(s(x)))

Submission status: Accepted

Solution code:
X = int(input())
n = X // 100
X = X - n * 100
ans= 1
while n > 0:
    if X >= 5:
        X = X - 5
    elif X >= 4:
        X = X - 4
    elif X >= 3:
        X = X - 3
    elif X >= 2:
        X = X - 2
    elif X >= 1:
        X = X - 1
    elif X == 0:
        break
    n -= 1
if X > 0:
    ans = 0
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
if x < 100:
    print(0)
    exit()
a, b = divmod(x, 100)
if a * 5 >= b:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
# import sys
X = int(input())
# if 1 <= X and X < 100:
#     print("0")
#     sys.exit()
i = 0
dp = [0]*(X+1)
dp[0] = 1
for i in range(100, X+1):
    for j in range(6):
        if dp[i-(100+j)] == 0:
            pass
        else:
            dp[i] = 1
print(dp[X])

Submission status: Accepted

Solution code:
import sys
X = int(input())
if 1 <= X and X < 100:
    print("0")
    sys.exit()
i = 0
dp = [0]*(X+1)
dp[0] = 1
for i in range(100, X+1):
    for j in range(6):
        if dp[i-(100+j)] == 0:
            pass
        else:
            dp[i] = 1
print(dp[X])

Submission status: Accepted

Solution code:
X = int(input())

# 100-105
# 200-210
# 300-315
# ...
# 1900-1995
# 2000-2100
# 2100-
flag = False

if(X >= 2000):
    flag = True

for i in range(1, 20):
    if(i*100 <= X and X <= i*105):
        flag = True
        break

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

Submission status: Accepted

Solution code:
X = int(input())
DP = [[0]*(X+1) for i in range(6)]
A = [100+i for i in range(6)]
DP[0][0] = 1
for i in range(6):
    for x in range(X+1):
        if i==0:
            if x>=100:
                DP[i][x] = DP[i][x-100]
        else:
            a = A[i]
            DP[i][x] = DP[i-1][x]
            if x>=a:
                DP[i][x] = max(DP[i][x],DP[i][x-a])
print(DP[5][X])

Submission status: Accepted

Solution code:
def I(): return int(input())
##################################################
X = I()
dp = [0]*(X+1)    #IndexとXを合わせた。dpのIndex範囲:0~X
dp[0] = 1
for i in range(X+1):
    if dp[i]:
        for j in range(100,106):
            if i+j<=X:    #「out of lange」対策。
                dp[i+j] = 1
print(dp[-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
k = 0
x = X%100
while x!=0:
    k+=1
    for i in range(5,0,-1):
        if i<=x:
            x-=i
            break
X //= 100
print(1 if k<=X else 0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

cent = n//100
under_cent = n%100

if under_cent > cent*5:
  print(0)
else:
  print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
dp = [0 for i in range(100001)]
for i in range(100, 106):
    dp[i] = 1

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

print(dp[X])

Submission status: Accepted

Solution code:
X = int(input())
if X >2000:
  print("1")
else:
  flag = False
  for i in range(1,20,1):
    if not (X in range(100*i,105*i +1)) == False:
      print("1")
      flag = True
      break
  if flag ==False:
    print("0")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

h = x // 100
r = x % 100

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

Submission status: Accepted

Solution code:
X=int(input())
dp=[0]*(X+1)
dp[0]=1
A=[100,101,102,103,104,105]
for i in range(X+1):
    for k in A:
        if i-k>=0 and dp[i-k]:
            dp[i]=1
print(dp[X])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Author: cr4zjh0bp
# Created: Sun Mar 29 05:26:08 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

x = ni()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

n = X // 100
rest = X - n * 100

if n * 5 >= rest:
    print("1")
else:
    print("0")

Submission status: Accepted

Solution code:
X = int(input())

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

for i in range(X):
    if dp[i] == 1:
        for c in [100, 101, 102, 103, 104, 105]:
            dp[i+c] = 1

print(dp[X])

Submission status: Accepted

Solution code:
x = int(input())
for c in range(x+1):
  l = 100*c
  r = 105*c
  if l <= x <= r:
    print(1)
    exit()
else:
  print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
C, M = divmod(X, 100)

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

Submission status: Accepted

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