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:
from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import string
import queue
import copy
# import numpy as np
# import scipy
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
 
def inp(): # n=1
    return int(input())
def inpm(): # x=1,y=2
    return map(int,input().split())
def inpl(): # a=[1,2,3,4,5,...,n]
    return list(map(int, input().split()))
def inpls(): # a=['1','2','3',...,'n']
    return list(input().split())
def inplm(n): # x=[] 複数行
    return list(int(input()) for _ in range(n))
def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]
    return [list(map(int, input().split())) for _ in range(n)]

def main():
    x=inp()
    n=x//100
    for i in range(n+1):
        y=x-100*i
        if y<=i*5:
            print(1)
            return
    print(0)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
from itertools import combinations, permutations

def solve():
    input = sys.stdin.readline
    X = int(input())
    all100 = X // 100
    if X - all100 * 100 > 5 * all100: print(0)
    else: print(1)

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
X=int(input())
f=False
for i in range(1001):
    if i*100<=X<=i*105:
        f=True
        break

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

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    x = int(readline())
    c = x // 100
    x %= 100
    print(1 if 0 <= x <= 5 * c else 0)


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

X = int(readline())

ans = 0
for i in range(1, X):
    if X - 100*i < 0:
        break
    if 0 <= X-100*i <= 5*i:
        ans = 1
        break
print(ans)

Submission status: Accepted

Solution code:
X = int(input())
t = X%100
k = X//100

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

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
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
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    X=I()
    boo = [1]+[0]*X
    A = [100,101,102,103,104,105]
    for a in A:
        for i in range(X+1):
            if i-a>=0 and boo[i-a]:
                boo[i]=True
    print(int(boo[X]))
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())

def solve() :
    for i in range(10000) :
        if 100 * i <= X <= 105 * i :
            return 1
    return 0
    
print(solve())

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    x = I()
    m = 100001
    dp = [0]*m
    dp[0] = 1
    for j in (100,101,102,103,104,105):
        for i in range(m):
            if dp[i]:
                k = i+j
                if k < m:
                    dp[k] = 1
    print(dp[x])
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
x = int(input())

for i in range(100000):
    if 100*i<=x<=105*i:
        print(1)
        exit()
print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

for i in range(1001):
    y = x - (i * 100)
    if y < 0:
        break
    if y <= i*5:
        print(1)
        import sys
        sys.exit()
print(0)

Submission status: Accepted

Solution code:
X = int(input())

d, m = divmod(X, 100)

if m <= 5 * d:
  print(1)
else:
  print(0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import queue
import math
import copy
"""
N = int(input())
#S = input()
# (N,M) = (int(i) for i in input().split(" "))
# A = [int(i) for i in input().split()]
A = []
for i in range(N):
	A.append(int(input()))

print(A)

"""

N = int(input())
A = N//100
B = N%100

print((A*5>=B)*1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
dp = [0]*(x+1)
dp[0] = 1
for i in range(x):
    if dp[i] == 0:continue
    for v in [t for t in range(100,106)]:
        if i + v <= x:
            dp[i + v] = 1
print(dp[x])

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    X=int(input())
    n=X//100
    m=X%100
    print(1 if -(-m//5)<=n else 0)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())
DP = [0]*(x+1)
DP[0] = 1
for i in range(x):
    if not DP[i]:
        continue
    for j in range(6):
        k = i+100+j
        if 0<=k<=x:
            DP[k] = 1
print(DP[-1])

Submission status: Accepted

Solution code:
x=int(input())
n=x//100
x%=100
a=0
for i in [5,4,3,2,1]:
  while x>i-1:
    x-=i
    a+=1
if a>n:print(0)
else:print(1)

Submission status: Accepted

Solution code:
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: break
        dp[i+100+j] = 1
print(dp[-1])

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  X=I()

  sm1=sm2=0
  for i in range(1010):
    sm1+=100
    sm2+=105
    if sm1<=X and X<=sm2:
      return 1
  return 0

# main()
print(main())

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    x=int(input())
    for k in range(1,1001):
        if(100*k<=x<=105*k):
            print(1)
            return
    print(0)
resolve()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

X = int(read())

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(2000):
    if i * 100 <= x <= i * 105:
        print(1)
        exit()

print(0)

Submission status: Accepted

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

X=int(input())

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

Submission status: Accepted

Solution code:

X = int(input())

w = X // 100
amari = X % 100

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

Submission status: Accepted

Solution code:
import sys

X = int(input())

for i in range(10000):
  if i * 100 <= X <= i * 105:
    print(1)
    sys.exit()

print(0)

Submission status: Accepted

Solution code:

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

X = inp()
dp = [False]*(X+200)

dp[0] = True

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = [0] * 101010
X[0] = 1

for i in range(100, 101010):
    for j in range(100, 106):
        if X[i-j]:
            X[i] = 1

print(X[int(input())])

Submission status: Runtime Error

Solution code:
X = int(input())
dp = [True] + [False] * (X)

# 100~105円はyes
for i in range(100,106):
  dp[i] = True

for i in range(106,X+1):
  for j in range(100,106):
    if dp[i-j] == True:
      dp[i] = True
      break

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

Submission status: Runtime Error

Solution code:
X = int(input())
for i1 in range(1000000):
  if i1 * 100 <= X:
    for i2 in range(1000000):
      if i1 * 100 + i2 * 101 <= X:
        for i3 in range(1000000):
          if i1 * 100 + i2 * 101 + i3 * 102 <= X:
            for i4 in range(1000000):
              if i1 * 100 + i2 * 101 + i3 * 102 + i4 * 103 <= X:
                for i5 in range(1000000):
                  if i1 * 100 + i2 * 101 + i3 * 102 + i4 * 103 + i5 * 104 <= X
                    for i6 in range(1000000):
                      if 100 * i1 + 101 * i2 + 102 * i3 + 103 * i4 + 104 * i5 + 105 * i6 == X:
                        print("1")
                      else:
                        print("0")

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# DP解

x = int(input())
dp = [False for _ in range(x+1)]
dp[0] = True
for i in range(1, 100):
    dp[i] = False
for i in range(100, x+1):
    tmp = False
    for j in range(6):
        if i-(100+j) >= 0:
            tmp = (tmp or dp[i-(100+j)])
    if tmp:
        dp[i] = True
    else:
        dp[i] = False

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# DP解

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

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

Submission status: Runtime Error

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

x = int(input())

ok = False

def dfs(n, flg):
    global ok
    if ok: 
        return 
    if n == x:
        ok = True
        return
    if n > x:
        ok = False
        return
    dfs(n+100, ok) 
    dfs(n+101, ok) 
    dfs(n+102, ok) 
    dfs(n+103, ok) 
    dfs(n+104, ok) 
    dfs(n+105, ok) 

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()

int main()
{
    int x;
    cin >> x;

    int n = x / 100;

    if (100 * n <= x && x <= 105 * n)
    {
        cout << 1 << '\n';
    }
    else
    {
        cout << 0 << '\n';
    }

    return 0;
}

Submission status: Runtime Error

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

dp = [0]*(X+1)
lst = [100,101,102,103,104,105]
for i in range(100,106):
    dp[i] = 1

# dp[v] が存在するなら 1, しないなら 0
for v in range(100,X+1):
    for w in range(6):
        n = lst[w]
        if dp[v-n] == 1:
            dp[v] = 1
print(dp[X])

Submission status: Runtime Error

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

for i in range(100,x+1):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print(dp[x])

Submission status: Runtime Error

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

for i in range(100,x-105+1):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print(dp[x])

Submission status: Runtime Error

Solution code:
x = input()
k = int(x[0:-2])
x = int(x[-2:])

k -= x / 5
if x % 5 == 0 and k >= 0:
    print(1)
elif k > 0:
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
x = int(input())

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

if x < 100:
    print(0)
else:
    c = x//100
    for i in range(1<<c):
        tmp = 0
        for j in range(c):
            if ((i >> j) & 1):
                tmp += lis[j]
        if tmp == x:
            print(1)
            exit()
print(0)

Submission status: Runtime Error

Solution code:
N = int(input())

def buy(cost):
    if cost == N:
        print(1)
        exit()
    if cost < N:
        for i in range(100, 106):
            buy(cost+i)
buy(0)

if buy(0) is None:
    print(0)

Submission status: Runtime Error

Solution code:
num=(int)(input())
n=num//100
amari=num%100
if amari / n > 6:
  print(0)
else:
  print(1)

Submission status: Runtime Error

Solution code:
x=int(input())
if x>=2100:
  print(1)
  exit()

ans=[0]*2100
for a in range(22):
  for b in range(22):
    for c in range(22):
      for d in range(22):
        for e in range(22):
          for f in range(21):
            ans[a*100+b*101+c*102+d*103+e*104+f*105]=1
            
print(ans[x])

Submission status: Runtime Error

Solution code:
x=int(input())
if x>=2100:
  print(1)
  exit()

ans=[0]*2100
for a in range(22):
  for b in range(22):
    for c in range(22):
      for d in range(22):
        for e in range(22):
          for f in range(21):
            ans[a*100+b*101+c*102+d*103+e*104+f*105]=1
            
print(ans(x))

Submission status: Runtime Error

Solution code:
X = int(input())

l = [0,1,2,3,4,5]
a = X // 100
b = X % 100

if ((b // a) in l) and ((b % a) in l):
    print('1')
else:
    print('0')

Submission status: Runtime Error

Solution code:
X = int(input())

a = X // 100
b = X % 100
print(1 if (b // a in [0,1,2,3,4,5]) and (b % a in [0,1,2,3,4,5]) else 0)

Submission status: Runtime Error

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


def main():
    x = int(readline().rstrip())
    ans = x // 100
    sur = x - ans * 100
    print(1 if sur / ans <= 5 else 0)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
x=int(input())
p=[100+i for i in range(6)]
def dp(x):
    if x<99:
        return False
    if x in p:
        return True
    else:
        if any(dp(x-i) for i in range(100,106)):
            return True
        else:
            False
print(1 if dp(x) else 0)

Submission status: Runtime Error

Solution code:
dp = [Yes] #i円の買い物ができるか
for i in range(99):
  dp.append(No)
for i in range(100, x+1):
  if(i < 106):
    dp.append(Yes)
  else:
    if((dp[i-100] == Yes) or (dp[i-101] == Yes) or (dp[i-102] == Yes) or (dp[i-103] == Yes) or (dp[i-104] == Yes) or (dp[i-105] == Yes)):
      dp[i].append(Yes)
    else:
      dp[i].append(No)
print(dp[x])

Submission status: Runtime Error

Solution code:
X = int(input())

dp = [0] * (100000)
dp[0] = 1

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

Submission status: Runtime Error

Solution code:
X = int(input())
coins = [100,101,102,103,105]
DP = [int(i%coins[0]==0) for i in range(X+1)]
for coin in coins[1:]:
  for i in range(X+1):
    DP[i] += DP[i - coin]
if DP[-1] != 0:
  print(1)
else:
  print(0)

Submission status: Runtime Error

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

def solve(x):
    memo = [True] + [False]*x
    def dp(k):
        if k < 0:
            return False
        elif memo[k]:
            return True
        for i in range(100,106):
            if dp(k-i):
                memo[k-i] = True
                return True
        
        return False

    return dp(x)



def main():
    X = int(input())
    print(int(solve(X)))
    return

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

def solve(x):
    def dp(x):
        if x == 0:
            return True
        elif x < 0:
            return False
        for i in range(100,106):
            if dp(x-i):
                return True
        
        return False

    return dp(x)



def main():
    X = int(input())
    print(int(solve(X)))
    return

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
x = int(input())
kosuu, amari = x // 100, x % 100
ans = 0

for i in kosuu:
    amari -= 5
    if amari <= 0:
        ans = 1
        break

print(ans)

Submission status: Runtime Error

Solution code:
X = int(input())
number = X//100
teen = X%100

elif teen <= 5*number:
    print(1)
else:
    print(0)

Submission status: Runtime Error

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

a = X // 100
b = X % 100

m = 5*a

if b > m:
  print(0)
else:
  print(1)

Submission status: Runtime Error

Solution code:
X = int(input())

Dp = [False for _ in range(X+1)]

Dp[0] = True
for i in range(X+1):
    if any([Dp[i - j] == True for j in range(100, 107)]):
        Dp[i] = True
if Dp[X]:
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)

def f(x):
    memo = {}
    if x == 0:
        return True
    elif x < 0:
        return False
    for j in range(1,x+1)
        if j in memo.keys():
        	return f(memo[j])
    	for i in range(6):
        	if f(j-100-i):
            	memo[j] = True

    return memo[x]

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

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)

@tail_recursive
def f(x):
    memo = {}
    if x == 0:
        return True
    elif x < 0:
        return False
    elif x in memo.keys():
        return f(memo[x])
    for i in range(6):
        if f(x-100-i):
            memo[x] = True
            return True
    return False

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

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import decimal

def dfs(val,i,x):
    if val == x:
        return True
    if val > x or i > len(cost):
        return
    if dfs(val+cost[i],i+1,x):
        return True
    if dfs(val,i+1,x):
        return True
    return False

if __name__ == "__main__":
    x = int(input())
    cost = [100,101,102,103,104,105]
    a = dfs(0,0,x)
    if a == False:
        print(0)
    else:
        print(1)

Submission status: Runtime Error

Solution code:
x=int(input())
p=[100,101,102,103,104,105]
ans=[False]*2001
ans[0]=True
for i in range(2000):
    if ans[i]:
        for j in p:
            if i+j>2000:
                continue
            else:
                ans[i+j]=True
if x>2000:
    print(1)
elif ans(x):
    print(1)
else:
    print(0)

Submission status: Runtime Error

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

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

for i in range(X+1):
    for j in num:
        if i-j >= 0:
            if dp[i-j]:
                dp[i] = 1

for i in num:
    if not dp[X-i]:
        f = 0

print(f)

Submission status: Runtime Error

Solution code:
X = int(input())
'''
numの順番によっては買うことが出来ない金額が発生するためNG
num = [105, 104, 103, 102, 101, 100]

f = 0
for i in range(2**6):
    XX = X
    for j in range(6):
        if (i>>j)&1:
            XX %= num[j]
            if XX == 0:
                f = 1
print(f)
'''

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

dp = [0 for _ in range(X)]
dp[0] = 1
f = 1

for i in range(X):
    for j in num:
        if i-j >= 0:
            if dp[i-j]:
                dp[i] = 1

for i in num:
    if not dp[X-i]:
        f = 0

print(f)

Submission status: Runtime Error

Solution code:
X = int(input())
'''
numの順番によっては買うことが出来ない金額が発生するためNG
num = [105, 104, 103, 102, 101, 100]

f = 0
for i in range(2**6):
    XX = X
    for j in range(6):
        if (i>>j)&1:
            XX %= num[j]
            if XX == 0:
                f = 1
print(f)
'''

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

dp = [0 for _ in range(X)]
dp[0] = 1
f = 1

for i in range(X):
    for j in num:
        if i-j >= 0
            if dp[i-j]:
                dp[i] = 1

for i in num:
    if not dp[X-i]:
        f = 0

print(f)

Submission status: Runtime Error

Solution code:
X = int(input())
'''
numの順番によっては買うことが出来ない金額が発生するためNG
num = [105, 104, 103, 102, 101, 100]

f = 0
for i in range(2**6):
    XX = X
    for j in range(6):
        if (i>>j)&1:
            XX %= num[j]
            if XX == 0:
                f = 1
print(f)
'''

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

dp = [0 for _ in range(X)]
dp[0] = 1
f = 1

for i in range(X):
    for j in num:
        if i-j >= 0 and dp[i-j]:
            dp[i] = 1

for i in num:
    if not dp[X-i]:
        f = 0

print(f)

Submission status: Runtime Error

Solution code:
X = input()

ans = "1"
if int(X) < 100:
	ans = "0"


if not int(X[:-2])*5 >= int(X[-2:]):
	ans = "0"

print(ans)

Submission status: Runtime Error

Solution code:
x = int(input())
dp = [False] * (x+1)
dp[0] = 1
for i in range(0, x+1):
    if dp[i]:
        try:
            dp[i + 100] = True
            dp[i + 101] = True
            dp[i + 102] = True
            dp[i + 103] = True
            dp[i + 104] = True
            dp[i + 105] = True
        except IndexError:
            pass

if dp[x]:
    print(1)
else:
    print(0)x = int(input())
dp = [False] * (x+1)
dp[0] = 1
for i in range(0, x+1):
    if dp[i]:
        try:
            dp[i + 100] = True
            dp[i + 101] = True
            dp[i + 102] = True
            dp[i + 103] = True
            dp[i + 104] = True
            dp[i + 105] = True
        except IndexError:
            pass

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

Submission status: Runtime Error

Solution code:
s = time.time()
X = int(input())
if X < 100:
    print(0)
else:
    item = [100, 101, 102, 103, 104, 105]
    dp = [[False for _ in range(X//100+10)] for _ in range(X+10)]
    dp[0][0] = True
    dp[100][1] = True
    dp[101][1] = True
    dp[103][1] = True
    dp[102][1] = True
    dp[105][1] = True
    for x in range(200, X+1):
        for n in range(2, x//100+1):
            for i in item:
                if dp[x-i][n-1]:
                    dp[x][n] = True
                    if x == X:
                        break
    if True in dp[X]:
        print(1)
    else:
        print(0)
f = time.time()
print(f-s)

Submission status: Runtime Error

Solution code:
X = int(input())
item = [100, 101, 102, 103, 104, 105]
dp = [[False for _ in range(X//100+4)] for _ in range(X+1)]
dp[0][0] = True
dp[100][1] = True
dp[101][1] = True
dp[102][1] = True
dp[105][1] = True
for x in range(100, X+1):
    for n in range(1, X//100+4):
        for i in item:
            if dp[x-i][n-1]:
                dp[x][n] = True
if True in dp[x]:
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
X = int(input())
item = [100, 101, 102, 103, 104, 105]
dp = [[False for _ in range(X//100+4)] for _ in range(X+2)]
dp[0][0] = True
for x in range(X+2):
    for n in range(X//100+4):
        for i in item:
            if dp[x-i][n-1]:
                dp[x][n] = True
if True in dp[x]:
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
X = int(input())
item = [100, 101, 102, 103, 104, 105]
dp = [[False for _ in range(X//100+3)] for _ in range(X+1)]
dp[0][0] = True
for x in range(X+1):
    for n in range(X//100+3):
        for i in item:
            if dp[x-i][n-1]:
                dp[x][n] = True
if True in dp[x]:
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
n = str(input())
if len(n) <= 2:
    print(0)
else:
    a = n[0:-2]
    tens = int(n[-2])
    need = tens*2
    ones = int(n[-1])
    if ones == 0:
    elif ones <= 5:
        need += 1
    else:
        need +=2

    if need <= int(a):
        print(1)
    else:
        print(0)

Submission status: Runtime Error

Solution code:
n = str(input())
if len(n) < =2:
    print(0)
else:
    a = n[0:-2]
    tens = int(n[-2])
    need = tens*2
    ones = int(n[-1])
    if ones < 5:
        need += 1
    else:
        need +=2

    if need <= int(a):
        print(1)
    else:
        print(0)

Submission status: Runtime Error

Solution code:
n = str(input())
a = n[0:-2]
tens = int(n[-2])
need = tens*2
ones = int(n[-1])
if ones < 5:
    need += 1
else:
    need +=2

if need <= int(a):
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
n = str(input())
a =n[0:-2]
tens = int(n[-2])
need = tens*2
ones = int(n[-1])
if ones < 5:
    need += 1
else:
    need +=2

if need <= int(a):
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
n = str(input())
a =int(n[0:-3])
tens = int(n[-2])
need = tens*2
ones = int(n[-1])
if ones < 5:
    need += 1
else:
    need +=2

if need <= int(a):
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
def solve(target):
    n = int(target / 100)
    if n  100 <= target <= n  105:
        print(1)
    else:
        print(0)

solve(int(input()))

Submission status: Runtime Error

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 i in range(106, 100001):
    if any(DP[i-100], DP[i-101], DP[i-102], DP[i-103], DP[i-104], DP[i-105]):
        DP[i] = 1
print(DP[W])

Submission status: Runtime Error

Solution code:
X = int(input())
flag = 1
if X < 100:
  flag = 0
else:
  a = X%100
  b = a%10
  c = (a-b)/10
  count = 2*c
  if 1 <= b <= 5:
    conut += 1
  elif 6<= b <= 9:
    count += 2
  if X//100 < count:
    flag = 0
print(flag)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
cnt = 0
for i in range(1000):
    num = ''
    num += str(i // 100)
    num += str((i // 10) % 10)
    num += str(i % 10)
    j = 0
    for n in range(N):
        if S[n] == num[j]:
            j += 1
        if j == 3:
            break
    if j == 3:
        cnt += 1
print(cnt)

Submission status: Runtime Error

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

if X >= 2000:
    print(1)
else:
    limit, mods = divmod(X, 100)
    if mods / limit <= 5:
        print(1)
    else:
        print(0)

Submission status: Runtime Error

Solution code:
x = int(input())
if x<100:
  print(0)
else:
  n = x//100
  m = x%100
  
  dp = set([1,2,3,4,5])
  
  for i in range(n):
    t = set([])
    for dp_i in dp:
      for j in range():
      	t.add((dp_i+j)%100)
    dp = t 
  
  if m in dp:
    print(1)
  else:
    print(0)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**9)

x = input()
if len(x) < 3:
    print(0)

k = 0
if x[-3] == "0":
    k = 10
else:
    k = int(x[-3])

x = int(x[-2:])

products = [0, 1, 2, 3, 4, 5]

def dfs(comb_):
    if len(comb_) == k:
        return 1 if sum(comb_) == x else 0

    for product in products:
        comb = comb_[:]
        comb.append(product)
        if dfs(comb) == 1:
            return 1

    return 0

print(dfs([]))

Submission status: Runtime Error

Solution code:
X = int(input().split())

dp = [False] * (X + 1)
dp[0] = True
for i in range(X):
  if i:
    for x in [100, 101, 102, 103, 104, 105]:
      if i+x <= X:
        dp[i+x] = True

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

Submission status: Runtime Error

Solution code:
X = int(input())
dp = [0]*(X+1)
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(100, X+1):
    for j in range(6):
        dp[i] = max(dp[i], dp[i-100+j])

if dp[X]:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
sum = input()

if len(sum) < 2:
    print('0')
else:
    last_2_digit = sum[-2:]
    upper_digit = sum[:-2]

    if last_2_digit == '00':
        print('1')
    else:
        required_num = int(last_2_digit) // 5 + 1
        if int(upper_digit) >= required_num:
            print('1')
        else:
            print('0')

Submission status: Runtime Error

Solution code:
sum = input()
last_2_digit = sum[-2:]
upper_digit = sum[:-2]

if last_2_digit == '00':
    print('1')
else:
    required_num = int(last_2_digit) // 5 + 1
    if int(upper_digit) >= required_num:
        print('1')
    else:
        print('0')

Submission status: Runtime Error

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
if int(x1[0])+int(x1[1]) < c1+c2:
  print('0')
else:
  print('1')