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:
# 入力が10**5とかになったときに100ms程度早い
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


X = read_a_int()
# 買うことのできる値段はXは100*N<=X<=105*Nのはず。
for n in range(1000):
    if 100 * n <= X <= 105 * n:
        print(1)
        exit()
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

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

    min_ = x // 105
    max_ = x // 100

    for c in range(max_, max_ + 1):
        if 100 * c <= x <= 105 * c:
            return 1
    return 0


print(solve())

# 品物の個数 C が決まっていると、合計価格としてありうるものは 「100 × C 円以上 105 × C 円以下」 す
# べてになります。ですので、判定が簡単です。
# C = 1, 2, 3, …, X すべてに対して判定して、この中に 「ちょうど X 円の買い物をすることは可能」 と判定
# されたものがひとつでもあれば X 円の買い物ができ (その場合の答えは 「1」)、ひとつもなければどうやっ
# ても X 円の買い物ができません (その場合の答えは 「0」)。

# 範囲がすべて達成可能という考え方は、
# agc017bでも使ったが、意識できていない

Submission status: Accepted

Solution code:
import math
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**9)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

x = INT()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
items = list(range(100, 106))
dp = [0 for _ in range(0, X+1)]
dp[0] = 1

for i in range(0, len(dp)):
  for j in items:
    if i+j <= len(dp)-1 and dp[i] > 0:
      dp[i+j] += 1
      if i+j == X:
        print('1')
        exit()

print('0')

Submission status: Accepted

Solution code:
X = int(input())

item_value = [100, 101, 102, 103, 104, 105]
dp = [0] * (100001)
for value in item_value:
    dp[value] = 1

for i in range(200, X + 1):
    for value in item_value:
        if dp[i - value] == 1:
            dp[i] = 1

print(dp[X])

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

X = I()

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

Submission status: Accepted

Solution code:
x = int(input())

n = x // 100
f = 0

for j in range(n+1):
    if j*100 <= x <= j*105:
        f = 1

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import collections
import itertools as it
import math
import numpy as np

# A = input()
# A = int(input())
# A = map(int, input().split())
# A = list(map(int, input().split()))
# A = [int(input()) for i in range(N)]
#
# c = collections.Counter()

X = int(input())
nshohin = X // 100
amari = X % 100

print(0 if nshohin * 5 < amari else 1)

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:
import sys
from decimal import Decimal, ROUND_HALF_UP
import math
input = sys.stdin.readline
#sys.setrecursionlimit(1e9)

def main():
    """code here"""
    x=int(input())
    dp = [0]*(x+1)
    dp[0]=1
    for i in range(x+1):
        if dp[i]:
            for tmp in [100,101,102,103,104,105]:
                if i+tmp<=x:
                    dp[i+tmp]=1
    print(dp[-1])




if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():

    X = int(input())
    n1 = X // 105
    n2 = X // 100

    for j in range(n1, n2+1):
        v = X - 100 * j
        if 0 <= v <= 5*j:
            return '1'
    return '0' 

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

Submission status: Accepted

Solution code:
from functools import lru_cache
import sys
sys.setrecursionlimit(100000000)
money = [0,1,2,3,4,5]
n = int(input())
p = 0
lm = n//100
need = n - (lm*100)
@lru_cache(None)
def dfs( cur,limit):
    global p,need
    if not p:
        for i in range(6):
            now = cur+money[i]
            if limit+1 == lm:
                if now == need:
                    p =1
                    break
            elif limit+1<=lm:
                dfs(now,limit+1)
if n>=100:
    dfs(0,0)
    print(1 if p else 0)
else:
    print(0)

Submission status: Accepted

Solution code:
M = [100,101,102,103,104,105]
X = int(input())

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

for i in range(X):
    if dp[i] == 1:
        for j in M:
            if i + j <= X:
                dp[i+j] = 1
print(dp[-1])

Submission status: Accepted

Solution code:
n=int(input())
boo=[0 for i in range(10**5+1000)]
boo[100]=1
boo[101]=1
boo[102]=1
boo[103]=1
boo[104]=1
boo[105]=1
for i in range(100,n+1):
  if boo[i]==1:
    for j in range(6):
      boo[i+100+j]=1
if boo[n]:
  print(1)
else:
  print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

dp = [0] * 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(106,X+1):
    dp[i] = dp[i-100] + dp[i-101] + dp[i-102] + dp[i-103] + dp[i-104] + dp[i-105]
    if dp[i] != 0:
        dp[i] = 1

print(dp[X])

Submission status: Accepted

Solution code:
X = int(input())

num_list = [0]*(100001 + 105)
num_list[0] = 1

for i in range(100001 + 105):
    if i == X:
        print(num_list[X])
        exit()

    for j in [100, 101, 102, 103, 104, 105]:
        if num_list[i]:
            num_list[i+j] = 1

print(0)

Submission status: Accepted

Solution code:
X = int(input())

ans = 0
while True:
  if X >= 100:
    k = X % 100
    if k <= 5:
      ans = 1
      break
    else:
      X -= 105
  else:
    break

print(ans)

Submission status: Accepted

Solution code:
ans = 0
N = int(input())
for i in range(10000):
    a = 100 * i 
    b = 105 * i
    if(a <= N <= b):
        ans =1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
x=1
while x<n//100+1:
  if 100*x<=n and n<=105*x:
    print(1)
    exit()
  x+=1
print(0)

Submission status: Accepted

Solution code:
import sys
X=int(input())
for c in range(X):
    if (100*c<=X) and (105*c>=X):
        print(1)
        sys.exit()
print(0)

Submission status: Accepted

Solution code:
x = int(input())

quot = x//100
rem = x%100

if rem <= quot*5:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
from pprint import pprint
import sys

def solve(n):
    for i in range(n // 100 + 1):
        if 100 * i <= n <= 105 * i:
            print(1)
            return
    
    print(0)
    

if __name__ == "__main__":
    n = int(sys.stdin.readline().strip())
    solve(n)

Submission status: Accepted

Solution code:
x = int(input())

n = x%100

q,r=divmod(n,5)

if r:
  q+=1

if x//100 >= q:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
X=int(input())

def func(i):
    global n
    global hoge
    n-=int(hoge/i)
    hoge=hoge%i

n=int(X/100)
hoge=X%100

for i in [5,4,3,2,1]:
    func(i)
if n<0:
    print(0)
else:
    print(1)

Submission status: Accepted

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

    if 1 <= X <= 99:
        return '0'
    if 100 <= X <= 105:
        return '1'
    can_pay = [False] * (X + 1)  # [i]: i円の買い物ができるなら True
    for i in range(100, 106):
        can_pay[i] = True
    for i in range(106, X + 1):
        for j in range(100, 106):
            if i - j >= 0 and can_pay[i - j]:
                can_pay[i] = True
                break
        else:
            can_pay[i] = False
    return '1' if can_pay[X] else '0'

print(c_100_to_105())

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
list = [100,101,102,103,104,105]
# a = [list[i] * 2000 for i in range(len(list))]

N = int(input())

dp = [0 for i in range(N+1)]
dp[0] = 1

for i in range(N):
    if dp[i] == 1:
        for j in range(len(list)):
            if i + list[j] <= len(dp)-1:
                
                dp[i+list[j]]=1


print(dp[-1])

Submission status: Accepted

Solution code:
from functools import reduce
from operator import add
X = int(input())
if X <= 105:
  if X<100:  print(0)
  else: print(1)
else:
  dp = [1] + [0]*X
  dp[100] = dp[101] = dp[102] = dp[103] = dp[104] = dp[105] = 1
  for i in range(106,X+1): dp[i] = min(reduce(add, [dp[i-(100+j)] for j in range(6)]),1)
  print(dp[-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

if X <= 99:
  print("0")
else:
  keta = X % 100  
  mai = keta // 5
  betu_mai = keta - mai * 5
  if betu_mai == 0:
    min = 105 * mai
  else:
    min = 105 * mai + int(str("10" + str(betu_mai)))
  
  if X >= min:
    print("1")
  else:
    print("0")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

x = int(input().rstrip())
c = 0

while True:
    if 100*c <= x <= 105*c:
        print(1)
        exit()
    if 100*c > x:
        break
    c += 1
print(0)

Submission status: Accepted

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

Submission status: Accepted

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

kosu = x // 100

if kosu * 100 <= x <= kosu * 105:
    print(1)
else:
    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())
for i in range(1001):
    if X>=100*i and X<=105*i:
        print(1)
        break
else:
    print(0)

Submission status: Accepted

Solution code:
X = int(input())

def test(x):
    low = 100 * x
    high = 105 * x
    return low <= X <= high

bl = any([test(x) for x in range(X)])

print(bl*1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def main():
  X = int(input())
  count = math.floor(X / 100)
  if ((X >= 100 * count) and (X <= 105 * count)):
    print(1)
  else:
    print(0)

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

for n_buy in range(X//105, X//100+1):
    if n_buy * 100 <= X <= n_buy * 105:
        print(1)
        exit()
print(0)

Submission status: Accepted

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

a = X % 100
b = X// 100
count = 0
if a == 0:
    print(1)
elif a % 5 == 0:
    if b >= a/5:
        print(1)
    else:
        print(0)
        
else:
    x = a // 5 + 1
    if b >= x:
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
import math

def read():
    X = int(input().strip())
    return X,


def solve(X):
    if X >= 2000:
        return 1
    A = [100 ,101, 102, 103, 104, 105]
    NA = 6
    dp = [[False for j in range(X+1)] for i in range(NA+1)]
    for i in range(NA+1):
        dp[i][0] = True
    for i in range(NA):
        for x in range(0, X+1):
            j = 0
            while x - j * A[i] >= 0:
                if dp[i][x - j * A[i]]:
                    dp[i+1][x] = True
                j += 1
    return 1 if dp[NA][X] else 0
    
if __name__ == '__main__':
    inputs = read()
    output = solve(*inputs)
    print("%d" % output)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# C - 100 to 105
X = int(input())

for a in range(2501):
    for b in range(2501-100*a):
        for c in range(2501-100*a-101*b):
            for d in range(2501-100*a-101*b-102*c):
                for e in range(2501-100*a-101*b-102*c-103*d):
                    for f in range(2501-100*a-101*b-102*c*103*d-104*e):
                        if 100*a+101*b+102*c+103*d+104*e+105*f == X:
                            print(1)
                            exit()
                        else:
                            pass
print(0)

Submission status: Accepted

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
'''
def GI(V,E,DAG=False,index=0):
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[1:])
            bb=(inp[1:])
        g[a].append(b)
        if g[b].append(a)
        h.append(b)
'''

def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()
 
show_flg=False
show_flg=True



n=I()

dp=[0]*(1+n)
dp[100:106]=[1]*6
for i in range(1+n):
    for j in range(100,106):
        if i-j>=0:
            dp[i]=max(dp[i],dp[i-j])
print(dp[n])

Submission status: Accepted

Solution code:
x = int(input())

ans = 0
for i in range(1,100001):
  if 100 * i <= x and 105 * i >= x:
    ans = 1
    break

print(ans)

Submission status: Accepted

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

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

min_=N//105
max_= N//100 + 1
#print(min_,max_)
count=0
for m in range(min_,max_):
    X = N - 100*m
    for i in range(0,X+1):
        for j in range(0,(X-i)//2 +1):
            for k in range(0,(X-i-2*j)//3 +1):
                for l in range(0,(X-i-2*j-3*k)//4 +1):
                    count+=1
                    if count >= 5*10**7:
                        print(1)
                        sys.exit()
                    temp = (X-i-2*j-3*k-4*l)
                    if (temp % 5 == 0) and (m-i-j-k-l-temp//5>=0):
                        a=m-i-j-k-l-temp//5
                        t=temp // 5
                        print(1)
                        #print(N,m,a,i,j,k,l,t,100*a+101*i+102*j+103*k+104*l+105*t)
                        sys.exit()
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:
# -*- coding: utf-8 -*-
X = int(input())

n = X // 100
a = 100 * n
b = 105 * n

if a <= X <= b or X >= 2000:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import sys
X = int(input())
l = [100, 101, 102, 103, 104, 105]
dp = [0] * 1000000

dp[0] = 1
for i in range(100001):
   
    if dp[i] == 1:
        for j in range(6):
            dp[i + l[j]] = 1

print(dp[X])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=input()
if len(X)==1:
    s=int(X)
else:
    s=int(X[-1])+int(X[-2])*10
    

b=s//5
b_=s%5
c=b_//4
c_=b_%4
d=c_//3
d_=c_%3
e=d_//2
e_=d_%2
f=e_//1
f_=e_//1

sum=b+c+d+e+f
sum_=105*b+104*c+103*d+102*e+101*f

if sum_>int(X):
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
X = int(input())

q, r = divmod(X, 100)

if r == 0:
    print(1)
    quit()

cnt = 0
for i in reversed(range(1, 6)):
    a, r = divmod(r, i)
    cnt += a
    if r == 0:
        break

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

n = x / 100
sum = 0

for i in range(int(n)):
   sum += 5


if x % 100 <= sum:
   print(1)
else:
   print(0)

Submission status: Accepted

Solution code:
x = int(input())
a = list(False for i in range(x + 1))
a[0] = True
for i in range(1, x + 1):
    for j in range(6):
        if (i - 100 - j) >= 0:
            if a[(i - 100 - j)]:
                a[i] = True
if a[x]:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
def fun(N,V):
    cnt = 0

    for i in range(5):
        cnt += V // (5-i)
        V = V % (5-i)
        if V == 0:
            break

    if cnt<=N and V==0:
        flag = False
        print(1)
    else:
        flag = True
    
    return flag

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

    flag = True
    N = X//100
    V = X-N*100

    while flag:
        if N >= V/5:
            flag = fun(N,V)
            N -= 1
            V += 100
        else:
            flag = False
            print(0)

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())

if ((x%100)+4)//5 > x//100:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
X = int(input())
y = X//100
a = list(range(y*100,y*105+1))
if X in a:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
n = int(input())
#n = 417
x=n//100
y=n%100
#print(x)
#print(y)
seq = (1,2,3,4,5)
exists = False

for i in seq:
    sum = 0
    z = y%i
    #print( 'z = ' + str(z))
    if z == 0:
        sum = y//i
        #print(sum)
        #print('a')
    else:
        sum = (y//i) + 1
        #print(sum)
    if sum <= x:
        print('1')
        exists =True
        break

if not exists:
    print('0')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

a = X//100

Xlist = str(X)

import sys

if X <100:
    print(0)
    sys.exit()
    
if a*5+1 <= int(Xlist[-2] + Xlist[-1]) and int(Xlist[-2] + Xlist[-1]) <=99:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
import sys
x=int(input())
a=x%100
b=x-a
i=int(b/100)
sample_list = [1, 2, 3, 4, 5]

for j in reversed(sample_list):
  c=a//j
  a=a%j
  i=i-c
  if i<0:
    print(0)
    sys.exit()
  elif i==0:
    if a==0:
      print(1)
      sys.exit()
    else:
      print(0)
      sys.exit()
  elif i>0:
    if a==0:
      print(1)
      sys.exit()
print(0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    x = int(args[0])
    dp = [0]*(x+200)
    dp[0] = 1
    for i in range(x):
        if not dp[i]:
            continue

        for k in range(6):
            dp[i+100+k] = 1

    return str(dp[x])


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Accepted

Solution code:
menu_yen = [100, 101, 102, 103, 104, 105]
menu_ten_yen = [1, 2, 3, 4, 5]
amount_of_menu = [100000]*len(menu_yen)

N = int(input())
if N<100:
    print(0)
    exit(0)

s = str(N)
h = int("".join(s[:-2]))
t = int("".join(s[-2:]))
total = [0]*5
for i in range(101):
    total[0] = i
    if t<total[0]:
        continue
    for j in range(51):
        total[1]=2*j+total[0]
        if t<total[1]:
            continue
        for k in range(34):
            total[2]=3*k+total[1]
            if t<total[2]:
                continue
            for l in range(26):
                total[3]=4*l+total[2]
                if t<total[3]:
                    continue
                for m in range(21):
                    total[4]=5*m+total[3]
                    if t<total[4]:
                        continue
                    if t==total[4] and (i+j+k+l+m)<=h:
                        print(1)
                        exit(0)
print(0)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())

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

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

cnt = X // 100
zan = X % 100

if zan > cnt * 5:
    print(0)
else:
    print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(1 if (lambda x: sum([i*100<=x and x<=i*105 for i in range(101010)]))(int(input())) else 0)

Submission status: Accepted

Solution code:
X = int(input())

while X > 99:
    if str(X)[-1] >= "5" or str(X)[-2] != "0":
        X -= 105
    elif str(X)[-1] == "4":
        X -= 104
    elif str(X)[-1] == "3":
        X -= 103
    elif str(X)[-1] == "2":
        X -= 102
    elif str(X)[-1] == "1":
        X -= 101
    elif str(X)[-1] == "0":
        X -= 100
# print(X)
if X == 0:
    print(1)
else:
    print(0)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import sys

X = int(input())

x = X // 100
if x * 5 < (X -( X // 100 * 100)):
    print(0)
    sys.exit()

if (x + 5) // 5 <= x:
    print(1)

else:
    print(0)

Submission status: Accepted

Solution code:
x = int(input())

max_val = x // 100
min_val = x // 105

if min_val * 100 <= x and x <= max_val * 105:
    ans =1
else:
    ans = 0

print(ans)

Submission status: Accepted

Solution code:
x = int(input())
if x < 100:
	print(0)
	exit()
a = x //100
"""
l = len(str(x))
y = str(x)
head = int(y[0])
"""
tail = x - a*100
#print(tail)

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

Submission status: Accepted

Solution code:
from itertools import combinations_with_replacement
X = int(input())

S = [0, 1, 2, 3, 4, 5]
A = X // 100
B = X - (A * 100)
if A > B:
    print(1)
else:
    A_list = list(combinations_with_replacement(S, A))
    for i in A_list:
        if sum(i) == B:
            print(1)
            exit()
    else:
        print(0)

Submission status: Accepted

Solution code:
# coding: utf-8

def is_possible(q, mod):

    for i in range((mod//5)+1):
        if 5 * i > mod:
            break
        for j in range((mod//4)+1):
            if (5 * i) + (4 * j) > mod:
                break
            for k in range((mod//3)+1):
                if (5 * i) + (4 * j) + (3 * k) > mod:
                    break
                for l in range((mod//2)+1):
                    if (q - (i + j + k + l)) > mod - ((5 * i) + (4 * j) + (3 * k) + (2 * l)):
                        return True
                    elif (5 * i) + (4 * j) + (3 * k) + (2 * l) > mod:
                        break

    return False


X = int(input())

for i in range(6):
    if X % (100+i) == 0:
        print(1)
        exit(0)

q, mod = divmod(X, 100)

if is_possible(q, mod):
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
import math
import fractions
from functools import reduce

def loop1(i, k, ans):
  global arr, result
  for ai in range(int(math.floor(k/arr[i])+1)):
    if (i+1<len(arr)):
      loop1(i+1, k-arr[i]*ai, ans+[ai])
    else:
      if arr[i]*ai==k:
        result=ans+[ai]
        break
  return result

def gcd(*arr):
  return reduce(fractions.gcd, arr)

def loop2(i, k, ans):
  global arr, result
  if k%gcd(*arr[i:len(arr)])==0:
    for ai in range(int(math.floor(k/arr[i])+1)):
      if i+1<len(arr):
        loop2(i+1, k-arr[i]*ai, ans+[ai])
      else:
        result=(ans+[ai])
        break
  return result


arr=[100, 101, 102, 103, 104, 105]
k=int(input())
result=""
if k>=2200:
  print(1)
else:
  loop2(0, k, [])
  if result=="":
    print(0)
  else:
    print(1)

Submission status: Accepted

Solution code:
X=int(input())
N=0
if X<100:
    print("0")
elif X>=2000:
    print("1")
else:
    while N<21:
        res=X-100*N
        if res>5*N:
            count=0
            N+=1
            continue
        elif 0<=res and res<5*N+1:
            print('1')
            count=1
            break
        N+=1
    if count==0:
        print("0")

Submission status: Accepted

Solution code:
import itertools
import sys
X = int(input())
A = [i for i in range(100, 106)]
num = int(X/100)
if X < 100: print(0)
elif X > 105*num: print(0)
else:
    for comb in itertools.combinations_with_replacement(A, num):
        if X == sum(comb):
            print(1)
            sys.exit()
    print(0)

Submission status: Accepted

Solution code:
x=int(input())

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

Submission status: Accepted

Solution code:
X = int(input())
flag=False

if X>=2100:
  print(1)
  flag=True
else:
  for i in range(0,22):
    for j in range(0,22-i):
      for k in range(0,22-i-j):
        for l in range(0,22-i-j-k):
          for m in range(0,22-i-j-k-l):
            for n in range(0,22-i-j-k-l-m):
              if 100*i+101*j+102*k+103*l+104*m+105*n==X:
                if flag==False:
                  print(1)
                  flag=True
                  break
              
if flag==False:
  print(0)

Submission status: Accepted

Solution code:
x = int(input())
#101以上で100余り0にする
mod = [5,4,3,2,1]
while x % 100 != 0 and x > 100:
    xxx = int(str(x)[-2:])
    for m in mod:
        if xxx >= m:
            x -= (100+m)
            break
    # print(xxx)
    # print(x)
print(1) if x % 100 == 0 else print(0)

Submission status: Accepted

Solution code:
x = int(input())
f = (x%100)//5
ff = (x%100)%5
a = [0,101,102,103,104]
if 105*f+a[ff]<= x:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
x = int(input())
if len(str(x)) < 3:
  print(0)
else:
  print("1" if x//100 >= x/105 else "0")

Submission status: Accepted

Solution code:
X = int(input())

a = X%100
b = a//5

if b < X//100 or X%105==0 :print(1)
else:print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
d3 = 0
d21 = 0
if x >99:
    d3 = int(str(x)[-3])
    d21 = int(str(x)[-2::])


if 1 <= x < 100:
    print(0)

elif x < 1000:
    if (d3 * 105) % 100 < d21:
        print(0)
    else:
        print(1)

elif 1000 <= x < 2000:
    if (d3 * 105) % 100 + 50 < d21:
        print(0)
    else:
        print(1)

else:
    print(1)