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:
X = int(input())

dp = [0] * 100001
dp[100] = 1
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for j in range(106,100001):
    if dp[j - 100] == 1 or  dp[j - 101] == 1 or  dp[j - 102] == 1 or  dp[j - 103] == 1 or  dp[j - 104] == 1 or  dp[j - 105] == 1:
        dp[j] = 1

print(dp[X])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

dp = [False] * (X+1)
dp[0] = True
for i in range(1, X+1):
    dp[i] = any(dp[i-(X+1)-105:i-(X+1)-99])

print(int(dp[X]))

Submission status: Accepted

Solution code:
from collections import deque

def solve(X):
    if X >= 2000:
        return 1

    prices = list(range(100, 106))
    Q = deque([(0, 0)])
    while Q:
        i, pNow = Q.popleft()
        if i == 6:
            if pNow == X:
                return 1
        else:
            price = prices[i]
            for num in range(20):
                p2 = pNow + price*num
                if p2 > X: break
                Q.append((i+1, p2))

    return 0

X = int(input())

print(solve(X))

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/sumitrust2019/tasks/sumitb2019_c
x = int(input())
v = x // 100
modv = x % 100

if v > 0 and modv / v <= 5:
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

V = (100, 101, 102, 103, 104, 105)
#V = (3, 4, 8, 11)
Memo = [0] * (X+1)

if X < min(V):
    print (0)
    exit()

for i in range(len(V)):
    if V[i] > X:
      continue
    Memo[V[i]] = 1
    for j in range(1, X+1):
        if j - V[i] > 0:
            Memo[j] |= Memo[j-V[i]]

print (Memo[X])
#print (Memo)

Submission status: Accepted

Solution code:
import math

def main():
    X = int(input())
    # ans = False
    c = X // 100
    mx = 105 * c
    mn = 100 * c
    if mn <= X <= mx:
        print(1)
    else:
        print(0)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x = int(input())

dp = []

for i in range(x + 1):
  if i == 0:
    dp.append(1)
  elif i < 100:
    dp.append(0)
  elif i >= 100 and i <= 105:
    dp.append(1)
  elif 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.append(1)
  else:
    dp.append(0)
print(dp[x])

Submission status: Accepted

Solution code:
import math

def main():
    X = int(input())
    ans = False
    for i in range(X+1):
        mx = 105 * i
        mn = 100 * i
        if mn <= X <= mx:
            ans = True
    if ans:
        print(1)
    else:
        print(0)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

def main():
    X = int(input())
    cnt = X // 100
    diff = X - cnt * 100
    if diff <= 5 * cnt:
        print(1)
    else:
        print(0)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x = int(input())
# c = int(x / 100)
# print(c)

for c in range(1, x + 1):
  if x >= c * 100 and x <= c * 105:
    print(1)
    exit(0)
print(0)

Submission status: Accepted

Solution code:
x = int(input())
c = int(x / 100)
# print(c)

for i in range(c * 100, c * 105 + 1):
  if i == x:
    print(1)
    exit(0)
print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

X = int(input())
print(1 if math.ceil((X - (X // 100) * 100) / 5) <= X // 100 else 0)

Submission status: Accepted

Solution code:
X = int(input())

max_num = X // 100 + 1

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

print("0")

Submission status: Accepted

Solution code:
X = int(input())
dp = [False] * (X + 1)
dp[0] = True
for x in range(X+1):
  if x - 100 >= 0 and dp[x-100] == True:
    dp[x] = True
  elif x - 101 >= 0 and dp[x-101] == True:
    dp[x] = True
  elif x - 102 >= 0 and dp[x-102] == True:
    dp[x] = True
  elif x - 103 >= 0 and dp[x-103] == True:
    dp[x] = True
  elif x - 104 >= 0 and dp[x-104] == True:
    dp[x] = True
  elif x - 105 >= 0 and dp[x-105] == True:
    dp[x] = True
  elif x % 100 == 0 or x % 101 == 0 or x % 102 == 0 or x % 103 == 0 or x % 104 == 0 or x % 105 == 0:
    dp[x] = True
print(1 if dp[-1] else 0)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

N = X//100
while N>0:
    Y = X-100*N
    if 0<=Y<=5*N:
        print(1)
        break
    N-=1
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

x = int(input())   

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

Submission status: Accepted

Solution code:
def solve():
	X = int(input())
	quotient = X // 100
	remainder = X % 100
	if 0 <= remainder and remainder <= 5 * quotient:
		print(1)
		exit()
	print(0)
solve()

Submission status: Accepted

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

Submission status: Accepted

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


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

    # dpによる解法
    # See:
    # https://atcoder.jp/contests/sumitrust2019/submissions/8726444
    dp = [False for _ in range(x + 200)]  # 配列を大きめに確保
    dp[0] = True  # 初期化

    for i in range(x + 10):
        if not dp[i]:
            continue

        # ある値に+100～+105できるとき
        for j in range(100, 106):
            dp[i + j] = True

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())


def check_exist(X):
    for i in range(1, X + 1):
        start_point = i * 100
        end_point = i * 105
        for j in range(start_point, end_point + 1):
            if X == j:
                return True
                break


if check_exist(X):
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())


def check_exist(X):
    for i in range(1, X + 1):
        start_point = i * 100
        end_point = i * 105
        for j in range(start_point, end_point + 1):
            if X == j:
                return True


if check_exist(X):
    print(1)
else:
    print(0)

Submission status: Accepted

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


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

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

    p, q = divmod(x, 100)

    if q <= p * 5:
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def solve():
	X = int(input())
	for i in range(X + 1):
		rest = X - i * 100
		if 0 <= rest and rest <= 5 * i:
			print(1)
			exit()
		if rest < 0:
			break
	print(0)
solve()

Submission status: Accepted

Solution code:

N = int(input())

DP = [False]*(N+1000)
prices = [100,101,102,103,104,105]
DP[0] = True
for i in range(N):
    if DP[i]:
        for p in prices:
            DP[i+p] = True

if DP[N]:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x=int(input())
z=x/100
x=x%100
f=0
j=0
m=0
for i in range(1,1000):
    if i>z:
        break
    else:
        j+=1
        m=6+5*(j-1)
        if x<m:
            f=1
            break
if f:
    print("1")
else:
    print("0")

Submission status: Accepted

Solution code:
from sys import stdin
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
x = int(stdin.readline().rstrip())

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

Submission status: Accepted

Solution code:
x = int(input())
if x < 100:
    print(0)
    exit()

l_num = x // 100
l_sum = x % 100

if l_sum <= l_num * 5:
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import queue
x=int(input())
avail=list(range(100,106))
ok=[False]*max(x+1,106)
q=queue.Queue()
for i in avail:
    ok[i]=True
    q.put(i)
while not q.empty():
    f=q.get()
    for i in range(100,106):
        if(i+f<=x and not ok[i+f]):
            ok[i+f]=True
            q.put(i+f)
print(1 if ok[x] else 0)

Submission status: Accepted

Solution code:

X = int(input())

R = X / 100
Q = X % 100


cnt = 0

while(Q > 0):
  cnt+= 1
  if(Q < 5):
      Q = 0
  else:
      Q -=5
if cnt < R:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
X = int(input())
R = X / 100
Q = X % 100

cnt = 0
while (Q > 0):
    cnt += 1
    if (Q < 5):
        Q = 0
    else:
        Q -= 5

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
k = int(x/100)
h = x%100
h2 = 0
for i in range(k):
    if h-h2>=5:
        h2+=5
    elif h-h2>=4:
        h2+=4
    elif h-h2>=3:
        h2+=3
    elif h-h2>=2:
        h2+=2
    elif h-h2>=1:
        h2+=1
    else:
        pass
print(1) if h2 == h else print(0)

Submission status: Accepted

Solution code:
x=int(input())
num=x//100
for i in range(100*num,105*num+1):
  if i==x:
    print(1);exit()
print(0)

Submission status: Accepted

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

S = 0
for i in range(1, 6)[:: -1]:
    S += (100 + i) * (m // i)
    m -= m // i * i

if S > X:
    print('0')
else:
    print('1')

Submission status: Accepted

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

for i in range(1, 1000):
    if 100*i <= X <= 105*i:
        ans = 1

print(ans)

Submission status: Accepted

Solution code:
x = int(input())

dp = [0 for _ in range(100001)]
dp[0] = 1
dp[100] = 1
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1
for i in range(200, 100001):
    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

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

Submission status: Accepted

Solution code:
import sys

def main():
    x = int(sys.stdin.readline().rstrip())
    q, r = divmod(x, 100)

    if 5 * q >= r:
        ans = 1
    else:
        ans = 0

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
X=int(input())
while X>0:
  if X%100>=5 :X-=105
  elif X%100==4:X-=104
  elif X%100==3:X-=103
  elif X%100==2:X-=102
  elif X%100==1:X-=101
  elif X%100==0:break

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

Submission status: Accepted

Solution code:
from itertools import combinations_with_replacement as comb

def f(n, h):
    for i in comb(range(6), n):
        if sum(i) == h:
            return 1
    return 0

if __name__ == '__main__':
    x = int(input())
    n = x // 100
    h = x - 100 * n
    print(f(n, h))

Submission status: Accepted

Solution code:
x=int(input())
dp=[0]*(x+1)
dp[0]=1
for i in range(1,x+1):
  if i-100>=0:
    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 i in range(X+1)]
if X <100:
    print(0)
elif X <= 105:
    print(1)
else:
    for i in range(100,106):
        dp[i] =1
    for i in range(100,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())
n = x//100

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    X = int(input())
    dp = [0]*(X+1)
    dp[0] = 1

    for i in range(X):
        if dp[i]==0:
            continue
        for j in range(6):
            if i + (100 + j) <= X:
                dp[i + (100 + j)] = 1

    print(dp[X])
    # print(dp)


if __name__ == '__main__':
    main()

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

quo = x // 100
rem = x % 100

req = rem // 5

if rem % 5:
  req += 1
  
if req > quo:
  print(0)
else:
  print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/sumitrust2019/tasks/sumitb2019_c

import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    x = int(input())
    dp = [False] * (100000 + 1)
    dp[0] = True

    for p in [100,101,102,103,104,105]:
        for i in range(100000 + 1):
            if p <= i:
                dp[i] |= dp[i-p]

    print(1 if dp[x] else 0)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())  # 金額
product_amount = X // 100
hasuu = X % 100
# print(product_amount)
# print(hasuu)
if 5 * product_amount >= hasuu:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    X = int(stdin.readline().rstrip())

    n = X//100
    under = X - n * 100

    if under > n*5:
        print(0)
    else:
        print(1)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
t=[100,101,102,103,104,105]
N=int(input())
for i in t:
        if N%i==0:
                print(1)
                exit()
a,b = divmod(N,100)
c,d = divmod(b,5)
if a >= c+1:
        print(1)
else: print(0)

Submission status: Accepted

Solution code:
# coding: utf-8

X = int(input())
q = X//100
mod = X%100

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

Submission status: Accepted

Solution code:
A = 1
for i in range(20):
    for j in range(100, 106):
        A = A | (A << j)
N = int(input())
print(1 if N >= 2000 else A >> N & 1)

Submission status: Accepted

Solution code:
A = 7175816845464090776455207507270117755723765735430536804658747273399161802972634276448409301356909248005606116656073561929444931323143190717332175076262060295351620527202705615498306139275508555689509950694997345595674093104433020700546656778950085095645658807229584194806623377338842753774743833376783450229118372573460572454731223569400078753907185233376010906274531347459925723690095854183385568140762360863180004465626012327328449425540345922055914421850333689171725134946657507151835356233535112180627200151906292121106447641907908790376379132422532166122413876168625333717615295123397246508335105
N = int(input())
print(1 if N >= 2000 else A>>N & 1)

Submission status: Accepted

Solution code:
import math
x = int(input())
c_min = math.ceil(x/105)
c_max = x/100
 
if c_min <= c_max:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
import sys

payable = [False] * (10 ** 5 + 1)
payable[0] = True
for i in range(100,106):
    payable[i] = True

for i in range(106, 10 ** 5 + 1):
    payable[i] = any(payable[i-105:i-99])

def main():
    x = int(sys.stdin.readline().rstrip())
    print(payable[x] & 1)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
if n >= 2000:
    print(1)
    quit()
x = n//100
if x*100 <= n <= x*105:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
import sys

def main():
    x = int(sys.stdin.readline().rstrip())

    payable = [False] * (x + 1)
    payable[0] = True

    if x < 100:
        print(0)
        sys.exit()
    if 100 <= x <= 105:
        print(1)
        sys.exit()

    for i in range(100,106):
        payable[i] = True
    for i in range(106, x+1):
        payable[i] =  any(payable[i-105:i-99])

    print(payable[x] & 1)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import numpy as np
def main():
    x = int(sys.stdin.readline().rstrip())
    
    if x < 100:
        print(0)
        sys.exit()
    if 100 <= x <= 105:
        print(1)
        sys.exit()

    dp = np.zeros_like(np.arange(x+1), dtype=bool)
    dp[100:106] = True
    for i in range(106, x+1):
        dp[i] =  np.any(dp[i-105:i-99])

    print(dp[x] & 1)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

cnt = 0
for i in range(1000):
  if 100*i <= x <= 105*i:
    print(1)
    cnt = 1
    break
if cnt == 0:
  print(0)

Submission status: Accepted

Solution code:
import sys 

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

Submission status: Accepted

Solution code:
n=int(input())
a=n//100
b=n%100
print((int)(b<=a*5))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())

dp = [False for _ in range(x+1)]
dp[0] = True 
for i in range(x+1):
    if i >= 100:
        dp[i] = dp[i] or dp[i-100]
    if i >= 101:
        dp[i] = dp[i] or dp[i-101]
    if i >= 102:
        dp[i] = dp[i] or dp[i-102]
    if i >= 103:
        dp[i] = dp[i] or dp[i-103]
    if i >= 104:
        dp[i] = dp[i] or dp[i-104]
    if i >= 105:
        dp[i] = dp[i] or dp[i-105]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
if X >= 2000:
    print(1)
elif X<= 99:
    print(0)
else:
    c = 0
    for i in range(1,20):
        if int(X//100) == i:
            if X%100 <= i*5:
                c=1
    print(c)

Submission status: Accepted

Solution code:
X = input()

last2 = int(X[len(X)-2:])
try_num = int(X) //100

if try_num >= 20:
    print(1)
    exit(0)

for i in range(try_num):
    if last2 > 5:
        last2 -= 5
    else:
        print(1)
        exit(0)
print(0)

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

def LI(): return list(map(int, sys.stdin.readline().split()))
X = int(input())
prices = [100,101,102,103,104,105]

#
# dp = [0 for i in range(2002)]
# for price in prices:
#     dp[price] = 1
# for i in range(len(dp)):
#     for price in prices:
#         if i > price and dp[i-price] == 1:
#             dp[i] = 1
#
# if X > 2000:
#     print("1")
# else:
#     print(dp[X])



dp = [0 for i in range(max(X + 1, 106))]
for price in prices:
    dp[price] = 1
for i in range(len(dp)):
    for price in prices:
        if i > price and dp[i - price] == 1:
            dp[i] = 1

print(dp[X])

Submission status: Accepted

Solution code:
n = int(input().strip())
valid = { 0: True }
for i in range(1, n+1):
  valid[i] = any(valid.get(i-j, False) for j in range(100, 106))
print (1 if valid[i] else 0)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def solve():
  x = int(input())
  ans = 0
  for i in range(1,20001):
    if 100*i <= x and x <= 105*i:
       ans = 1
  print(ans)
solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())

item_number = num//100
temp_val = num%100
times = temp_val //5

if temp_val % 5 != 0:
    times += 1

# print(item_number)
# print(times)

if item_number >=times:
    print(1)
else:
    print(0)

Submission status: Accepted

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

for i in range(106, 100010):
    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(1 if dp[x] else 0)

Submission status: Accepted

Solution code:
import itertools as it

num = int(input())

item_number = num//100
temp_val = num%100

times = temp_val //15
temp_val = temp_val % 15

if temp_val <= 5:
    temp_val = 1
elif temp_val <= 10:
    temp_val = 2
else:
    temp_val =3

need_item_number = 3*times + temp_val

# print(item_number)
# print(times)
# print(need_item_number)

if item_number >= need_item_number:
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools as it

num = int(input())

item_number = num//100

if item_number>= 20:
    item_number = 20

res_list = []
candi_list = list(it.combinations_with_replacement([100, 101, 102, 103, 104, 105], item_number))
candi_ans_list = [sum(item) for item in candi_list]

if num >= 2000:
    print(1)
else:

    if num in candi_ans_list:
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

X = ri()
q, r = divmod(X, 100)
bool = True
if q * 5 < r:
    bool = False
print(1 if bool else 0)

Submission status: Accepted

Solution code:
n=int(input())
print(1 if n%100*21<=n else 0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=int(input())
print(int((s%100+4)//5*100<=s))

Submission status: Accepted

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

print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

X_mod = X%100
X_count = X//100

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

ans = 0
if count <= X_count:
  ans = 1
else:
  ans = 0

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

out = 1

if n < 100:
  out = 0
for i in range(1,20):
  if i*105 < n < (i+1)*100:
    out = 0

print(out)

Submission status: Accepted

Solution code:
n=int(input());print(+(n%100*21<=n))

Submission status: Accepted

Solution code:
n=int(input());print(+(n//100*5>=n%100))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
try:print(+(n%100/(n//100)<=5))
except:print(+(n<1))

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

X = INT()

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

Submission status: Accepted

Solution code:
def c():
	X = int(input())
	can = [False]*(X+1)
	can[0] = True
	for i in range(X+1):
		for j in [100,101,102,103,104,105]:
			if j > i:
				break
			elif can[i-j]:
				can[i] = True
	print(int(can[X]))
c()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

# 商品の合計がi個の場合の可能なxの範囲
# i=1   100-105
# i=2   200-210
# i=3   300-315
# i=4   400-420
# i=5   500-525
# i=6   600-630
# i=7   700-735
# i=8   800-840
# i=9   900-945
# ...
# i=19 1900-1995
# i=20以降は常に1

i = x // 100

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

Submission status: Accepted

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


def solve(X: int):
    for i in range(1000):
        if i*100 <= X <= i*105:
            print(1)
            return 
    
    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:
n = int(input())
tmp=n//100
mod=n%100/5
if(mod<=tmp):
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())

q = X // 100
mod = X % 100

if q >= (mod / 5):
 print(1)

else:
 print(0)

Submission status: Accepted

Solution code:
N = int(input())
dp = [0]*(100000+1)
dp[100] = 1
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1
for i in range(200, N+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[N])

Submission status: Accepted

Solution code:
import math

x = int(input().strip())

sho = x//100
hasuu = x - 100*sho

if math.ceil(hasuu / 5) <= sho:
    print(1)
else:
    print(0)

Submission status: Accepted

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


def solve(X: int):
    dp = [False for _ in range(X+1)]
    dp[0] = True
    prices = [100,101,102,103,104,105]
    for i in range(1,X+1):
        for price in prices:
            if i >= price:
                if dp[i-price]:
                    dp[i] = dp[i-price]
                    break
    
    print(int(dp[X]))
    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:
n = int(input())

for i in range(1, n+1):
    if 100*i <= n <= 105*i:
        print(1)
        exit()

print(0)

Submission status: Accepted

Solution code:
import sys
import math

n=int(input())
a=n%100
b=math.floor(n/100)+1
f=True
while b != 0:
  for i in range(b):
    for j in range(b-i):
      for k in range(b-i-j):
        for l in range(b-i-j-k):
          for m in range(b-i-j-k-l):
            if i+2*j+3*k+4*l+5*m == a:
              print(1)
              sys.exit()
  a+=100
  b-=1
print(0)

Submission status: Accepted

Solution code:
def count(S, m, n): 
    if n < 100:
        return 0

    table = [False for k in range(n+1)]   
    table[100:106] = [True] * 6

    for i in range(106, n+1):
        table[i] = any([table[i-j] for j in range(S[0], S[-1]+1)])
  
    return 1 if table[n] else 0
  
def main():
    X = int(input())
    S = [100, 101, 102, 103, 104, 105] 
    print(count(S, len(S), X))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
X = int(input())
if X >= 100*101:
  print(1)
else:
  N1 = X//105
  N2 = X//100
  ans = 0
  for n in range(N1, N2 + 1):
    if (X >= 100*n)&(X <= 105*n):
      ans = 1
  print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    i = N//100
    if 100*i <= N <= 105*i:
        return print(1)
    else:
        return print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    for i in range(1, N+1):
        if 100*i <= N <= 105*i:
            return print(1)
    print(0)


if __name__ == '__main__':
    main()