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: Runtime Error

Solution code:
X = int(input())

a = str(X)
a = int(a[:-2])
b = X - a*100

if a >= 20:
    ans = 1

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

Submission status: Runtime Error

Solution code:
N = int(input())
N1 = N%100//5
N2 == 0
if N%100%5 == 0:
    N2 = 0
else:
    N2 = 1
S =N1+N2
if 100*S > N:
    print(0)
else:
    print(1)

Submission status: Runtime Error

Solution code:
import itertools as it

x = int(input())
f = 0

c = x // 100

l = list(it.combinations(range(100,106),c))

for i in l:
    if x % sum(i) == 0:
        f = 1

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

Submission status: Runtime Error

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


def solve(X: int):
    dp = [[False]*(X+1) for _ in range(7)]
    price = [100,101,102,103,104,105]
    X = 10000

    for i in range(7):
        dp[i][0] = True

    ## i番目まででjを払えるか
    for i in range(6):
        for j in range(X+1):
            if j >= price[i]:
                for k in range(1,j//price[i]+1):
                    if j-k*price[i]>=0:
                        dp[i+1][j] |= dp[i][j] or dp[i][j-k*price[i]]
                    if dp[i+1][j]:
                        break
            else:
                dp[i+1][j] = dp[i][j]

    if dp[6][X]:
        print(1)
    else:
        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: Runtime Error

Solution code:
import sys
n = int(input())
depth = n//100
if n%100 == 0:
    print(1)
    sys.exit()

for i,j in enumerate(str(n)):
    if i != 0 and j!=0:
        ans = i
        break
m = int(str(n)[ans:])

def judge(ad,n,depth,count):
    n -= ad
    if n<0 or count > depth:
        return 0
    elif n == 0:
        return 1
    count += 1

    r1 = judge(0,n,depth,count)
    r2 = judge(1,n,depth,count)
    r3 = judge(2,n,depth,count)
    r4 = judge(3,n,depth,count)
    r5 = judge(4,n,depth,count)
    r6 = judge(5,n,depth,count)
    return max(r2,max(max(r3,r4),max(r5,r6)))

print(judge(0,m,depth,0))

Submission status: Runtime Error

Solution code:
X = float(input())
p = int(N/100) #xが何百以上か判別する。
T=1 #TRUE
F=0 #FALSE
if p==0
 print(F)
 return 0

if X<=p*100:
 print(T)
else:
 print(F)

Submission status: Runtime Error

Solution code:
def count(S, m, n): 
    table = [0 for k in range(n+1)] 
  
    table[0] = 0
    if n <= 100:
        return 0
    if n <= 105:
        return 1

    table[100] = 1
    table[101] = 1
    table[102] = 1
    table[103] = 1
    table[104] = 1
    table[105] = 1

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

    if count(S, 8, X):
        print(1)
    else:
        print(0)
    
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
def subset_sum(numbers, target, partial=[]):
    s = sum(partial)

    # check if the partial sum is equals to target
    if s == target: 
        print "1"
    if s >= target:
        print "0"

    for i in range(len(numbers)):
        n = numbers[i]
        remaining = numbers[i+1:]
        subset_sum(remaining, target, partial + [n]) 

N = int(input())        
subset_sum([100,101,102,103,104,105],N)

Submission status: Runtime Error

Solution code:
MAX = 100000
prices = [100, 101, 102, 103, 104, 105]

result = [ 0 for x in range(MAX)]
result[100] = 1
result[101] = 1
result[102] = 1
result[103] = 1
result[104] = 1
result[105] = 1

x = int(input())
for v in range(100, x+1):
    for p in prices:
        if result[v] or result[v-p]:
            result[v] = 1
            break
print(result[x])

Submission status: Runtime Error

Solution code:
x = int(input())
l_len = x // 100
l_sum = x % 100

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


def issum(lis, l_sum, l_len, curr_sum, curr_len):
    if l_sum - curr_sum > (l_len - curr_len) * 5:
        return
    if curr_sum > l_sum or curr_len > l_len:
        return
    if curr_sum == l_sum and curr_len == l_len:
        return True
    for i in range(6):
        if issum(lis, l_sum, l_len, curr_sum + lis[i], curr_len + 1):
            return True
a = [0, 1, 2, 3, 4, 5]
if issum(a, l_sum, l_len, 0, 0):
    print(1)
else:
    print(0)

Submission status: Runtime Error

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

items = [100, 101, 102, 103, 104, 105]
# items = list(range(6))

def solve(d, m):
    if d == 0:
        if m == 0:
            return 1
        else:
            return 0
    for i in items:
        temp = solve(d - 1, m - i)
        if temp == 1:
            return 1
        else:
            continue
    return 0

def main():
    x = int(input())
    div_100, mod_100 = divmod(x, 100)
    # ans = solve(div_100, mod_100)

    ans = solve(div_100, x)

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import itertools
from collections import defaultdict as dict
d = dict(int)

N = int(input())
S = [int(_) for _ in input()]
s = list(itertools.combinations(S, 3))

for j in range(len(s)):

    # カウントアップ
    d[s[j]] += 1

print(len(d))

Submission status: Runtime Error

Solution code:
#-*- coding: utf-8 -*-
"""
oj dl https://atcoder.jp/contests/abc116/tasks/abc116_d -d test-d
oj test -d test-d -c "python abc116d.py"
oj test -d test-d -c "python abc116d.py" test-d/sample-3.in
"""
from collections import defaultdict
import sys
import math
from datetime import datetime
import re
import math

sys.setrecursionlimit(1000000)
#print (sys.getrecursionlimit())
def rec(zan, dp):
    # if zan % 100 == 0 or \
    #         zan % 101 == 0 or \
    #         zan % 102 == 0 or \
    #         zan % 103 == 0 or \
    #         zan % 104 == 0 or \
    #         zan % 105 == 0:
    #     print("zan {}".format(zan))
    if zan == 0:
        #print("hogaaaaaaaaaaaaaahhh ! {}".format(zan))
        return True
    elif zan < 0:
        return False
    else:
        if zan in dp: return dp[zan]
        # if zan-100 >= 0:
        #     a0 = rec(zan-100, dp)
        #     dp[zan -100] = a0
        # if zan-101 >= 0:
        #     a1 = rec(zan-101, dp)
        #     dp[zan -101] = a1
        # if zan-102 >= 0:
        #     a2 = rec(zan-102, dp)
        #     dp[zan -102] = a2
        # if zan-103 >= 0:
        #     a3 = rec(zan-103, dp)
        #     dp[zan -103] = a3
        # if zan-104 >= 0:
        #     a4 = rec(zan-104, dp)
        #     dp[zan -104] = a4
        # if zan-105 >= 0:
        #     a5 = rec(zan-105, dp)
        #     dp[zan -105] = a5

        a0 = rec(zan-100, dp)
        dp[zan -100] = a0
        a1 = rec(zan-101, dp)
        dp[zan -101] = a1
        a2 = rec(zan-102, dp)
        dp[zan -102] = a2
        a3 = rec(zan-103, dp)
        dp[zan -103] = a3
        a4 = rec(zan-104, dp)
        dp[zan -104] = a4
        a5 = rec(zan-105, dp)
        dp[zan -105] = a5
        #print(a0, a1, a2, a3, a4, a5)
        ans = any(
          [a0, a1, a2, a3, a4, a5]
        )
        dp[zan] = ans
        return ans

def sol(n):
    dp = [False] * (n+5)
    rec(n, dp)
    #print("dp[%s] = %s" % (n, dp[n]))
    return '1' if dp[n] else '0'



do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    n = int(parsed_lines[0][0])
    #k = int(parsed_lines[0][1])
    #S = parsed_lines[0][0]
    return n


if not do_submit:
    S = input_parse("""
    615
    """)
    print(sol(S))

    S = input_parse("""
    217
    """)
    print(sol(S))

else:
    #A, B = list(map(int, input().split()))
    S = int(input())
    print(sol(S))

    # S = input().strip()
    # print(sol(S))

Submission status: Runtime Error

Solution code:

import numpy as np
A = int(input())

if A >= 3000:
    print(1)
else:
    a = [100,101,102,103,104,105]  
    N = A//100
    dp = np.array([np.array([0 for i in range(A+1)]) for j in range(N+1)])
    dp[0][0] = 1
        
    for i in range(N):
        for j in np.where(dp[i] == 1)[0]:
        #for j in range(A+1):
           # if dp[i][j] == 1:
            dp[i+1][j+100:j+106] = 1
    
    print(dp[N][A])
    
    
    dp = [[0 for i in range(A+1)] for j in range(N+1)]
    dp[0][0] = 1
    
    for i in range(N):
        for j in range(A+1):
            if a[i] <= j:
                dp[i+1][j] = dp[i][j-a[i]] or dp[i][j]
            else:
                dp[i+1][j] = dp[i][j]
    
    print(dp[N][A])

Submission status: Runtime Error

Solution code:
x=int(input())
items = [100,101,102,103,104,105]
list = [1]
if x == 100 or x == 101 or x == 102 or x == 103 or x == 104 or x == 105:
    print(1)
elif x <100:
    print(0)
else:
    for i in range(99):
        list.append(0)
    for i in range(6):
        list.append(1)
    for i in range(94):
        list.append(0)
    for i in range(200,x+1):
        for item in items:
            if list[i-item] == 1:
                list.append(1)
                break
        else:
            list.append(0)

    print(list[x])
print(list[105])

Submission status: Runtime Error

Solution code:
line = input()
num = int(line[-2:])
item_number = int(line[:-2])



res_list = []
a = 5
while True:
    for _ in range(num//a):
        res_list.append(a)

    num = num % a

    if num <= 4:
        res_list.append(num)
        break

# print(res_list)

if len(res_list) > item_number:
    print(0)
else:
    print(1)

Submission status: Runtime Error

Solution code:
x=int(input())
items = [100,101,102,103,104,105]
list = [1]
if x == 100 or x == 101 or x == 102 or x == 103 or x == 104 or x == 105:
    print(1)
elif x <100:
    print(0)
else:
    for i in range(99):
        list.append(0)
    for i in range(6):
        list.append(1)
    for i in range(95):
        list.append(0)
    for i in range(200,x+1):
        for item in items:
            if list[i-item] == 1:
                list.append(1)
                break
        else:
            list.append(0)

    print(list[x])
print(list[105])

Submission status: Runtime Error

Solution code:
import sys
x=(input())
t = int(x[:-2])
x = int(x)
c = 0
while True:
    if x <= 100:
        break
    x -=105
    c += 1

if c == t:
    print(0)
else:
    print(1)

Submission status: Runtime Error

Solution code:
X = map(int,input())
X_a = X/100
X_b = X%100

if 0 <= X_b and X_b <= X_a*5:
  print(1)
else:
  print(0)

Submission status: Runtime Error

Solution code:
from __future__ import print_function
# import numpy as np
# import numpypy as np
import sys
input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd

def lcm(n,m):
    return int(n*m/gcd(n,m))

import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace

from queue import PriorityQueue as pq

def reduce(p, q):
    common = fractions.gcd(p, q)
    return (p//common , q//common )
# from itertools import accumulate
# from collections import deque

import random
import traceback

def main():
    x = int(input().strip())
    x_left=x%100                # x_leftはxの二桁目以下(0<=x_left<=99)
    x_d3above=x//100            # x_leftはxの三桁目以上(0<=x_d3above<=10^3)

    x_d1 = x_left % 10              # Xの一桁目
    x_d2 = x_left //10              # Xの二桁目

    sideEffect=0
    if x_d1==1:
        sideEffect+=100
    elif x_d1==2:
        sideEffect+=100
    elif x_d1==3:
        sideEffect+=100
    elif x_d1==4:
        sideEffect+=100
    elif x_d1==5:
        sideEffect+=100
    elif x_d1==6:
        sideEffect+=200
    elif x_d1==7:
        sideEffect+=200
    elif x_d1==8:
        sideEffect+=200
    elif x_d1==9:
        sideEffect+=200
    else:
        try:
            raise Exception
        except:
            traceback.print_exc("error!")

    if x_d2==1:
        sideEffect+=200
    elif x_d2==2:
        sideEffect+=400
    elif x_d2==3:
        sideEffect+=600
    elif x_d2==4:
        sideEffect+=800
    elif x_d2==5:
        sideEffect+=1000
    elif x_d2==6:
        sideEffect+=1200
    elif x_d2==7:
        sideEffect+=1400
    elif x_d2==8:
        sideEffect+=1600
    elif x_d2==9:
        sideEffect+=1800
    else:
        try:
            raise Exception
        except:
            traceback.print_exc()

    if (x//100)*100 < sideEffect:
        print(0)
    else:
        print(1)
        
    
    return

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys
n = int(input()
ans = n%615
for i in range(7):
    for j in range(7):
        for k in range(7):
            for l in range(7):
                for m in range(7):
                    for n in range(7):
                        tmp = 100*i+101*j + 102*k + 103*l * 104*m + 105*n
                        if ans == tmp:
                            print('1')
                            sys.exit()
                        elif m < tmp:break
print('0')

Submission status: Runtime Error

Solution code:
import numpy as np
x=int(input())
a=[100,101,102,103,104,105]
m=[1000000]*6
dplist = np.ones((7,x+1))*(-1)
dplist[0,0] = 0
for i in range(6):
    for j in range(x+1):
        if dplist[i,j] >= 0:
            dplist[i+1,j] = m[i]
        elif dplist[i+1,j-a[i]]<= 0:
            dplist[i+1,j] = -1
        elif j - a[i] < 0:
            dplist[i+1,j] = -1
        else:
            dplist[i+1][j] = dplist[i+1,j-a[i]] -1

if dplist[6,x] >= 0:
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
x = int(input())
l_len = x // 100
l_sum = x % 100

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


def issum(lis, l_sum, l_len, curr_sum, curr_len):
    if l_sum - curr_sum > (l_len - curr_len) * 5:
        return
    if curr_sum > l_sum or curr_len > l_len:
        return
    if curr_sum == l_sum and curr_len == l_len:
        return True
    for i in range(6):
#         print(i, l_len)
        if issum(lis, l_sum, l_len, curr_sum + lis[i], curr_len + 1):
            return True
a = [0, 1, 2, 3, 4, 5]
if issum(a, l_sum, l_len, 0, 0):
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
X = int(input())
ans = 0
tmp = str(X)
if len(tmp) >= 2:
    upper = int(tmp[:-2])
    under = int(tmp[-2:])
    if upper * 5 < under:
        ans = 0
    else:
        ans = 1
else:
    ans = 0

print(ans)

Submission status: Runtime Error

Solution code:
num = input()
n = int(num[0:-2])
m = int(num[-2::])

x = int(m/5)+1 if m%5!=0 else int(m/5)
s = int((n-x)/19)+1
for i in range(s):
  if x+20*i <= n+s <= m+100*i:
    print("1")
    break
else:
  print("0")

Submission status: Runtime Error

Solution code:
def main():
    X = input()
    A = [100,101,102,103,104,105]
    last = int(X[:len(X)-2])
    two = int(X[-2:])
    if two <= last*5:
        print(1)
    else:
        print(0)

if __name__=='__main__':
    main()

Submission status: Runtime Error

Solution code:
x = int(input())

# 最大n個は買う必要がある
n = x // 100

# 最低m個買う必要がある
m = x // 105

ans = 0
# もし割り切れたら、OK
for i in range(100,106):
  if x % i == 0:
    ans = 1
    break

shinamono = [100,101,102,103,104,105] * (n+1-m)
for i in range(m,n+1):
  if ans == 1:
    break
  a = itertools.combinations(shinamono, i)
  for j in a:
    if sum(j) == x:
      ans = 1
      break

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())
l_len = x // 100
l_sum = x % 100

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


def issum(lis, l_sum, l_len, curr_sum, curr_len):

    if curr_sum > l_sum or curr_len > l_len:
        return
    if curr_sum == l_sum and curr_len == l_len:
        return True
    for i in range(6):
#         print(i, l_len)
        if issum(lis, l_sum, l_len, curr_sum + lis[i], curr_len + 1):
            return True
a = [0, 1, 2, 3, 4, 5]
if issum(a, l_sum, l_len, 0, 0):
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
X = int(input())

import numpy as np


def judge(X):
	maxrange = min(int(X/100)+1, 1000000)
	for a in range(maxrange):
		for b in range(maxrange):
			for c in range(maxrange):
				S = 100 * a + 101 * b + 102 * c
				d = np.arange(0, maxrange)
				e = np.arange(0, maxrange)
				f = np.arange(0, maxrange)
				DEF = np.meshgrid(d, e, f)
				Splus = 103 * DEF[0] + 104 * DEF[1] * 105 * DEF[2]
				if np.any(Splus == X - S) == True:
					return 1
				else:
					continue
	return 0

print(judge(X))

Submission status: Runtime Error

Solution code:
X = int(input())

import numpy as np


def judge(X):
	maxrange = max(int(X/100)+1, 1000000)
	for a in range(maxrange):
		for b in range(maxrange):
			for c in range(maxrange):
				S = 100 * a + 101 * b + 102 * c
				d = np.arange(0, maxrange)
				e = np.arange(0, maxrange)
				f = np.arange(0, maxrange)
				DEF = np.meshgrid(d, e, f)
				Splus = 103 * DEF[0] + 104 * DEF[1] * 105 * DEF[2]
				if np.any(Splus == X - S) == True:
					return 1
				else:
					continue
	return 0

print(judge(X))

Submission status: Runtime Error

Solution code:
x=int(input())
items = [100,101,102,103,104,105]
list = [1]
if x == 100 or x == 101 or x == 102 or x == 103 or x == 104 x == 105:
    print(1)
elif x <100:
    print(0)
else:
    for i in range(99):
        list.append(0)
    for i in range(5):
        list.append(1)
    for i in range(95):
        list.append(0)
    for i in range(200,x+1):
        for item in items:
            if list[i-item] == 1:
                list.append(1)
                break
        else:
            list.append(0)

    print(list[x])

Submission status: Runtime Error

Solution code:
line = input()
num = int(line[-2:])
item_number = int(line[:-2])


res_list = []
a = 5
while True:
    num = num - a
    res_list.append(a)
    if num < a:
        a -= 1

    if num == 0 or a == 0:
        break

if len(res_list) > item_number:
    print(0)
else:
    print(1)

Submission status: Runtime Error

Solution code:
X = int(input())

import numpy as np


def judge(X):
	for a in range(int(X/100)+1):
		for b in range(int(X/100)+1):
			for c in range(int(X/100)+1):
				S = 100 * a + 101 * b + 102 * c
				d = np.arange(0, int(X/100)+1)
				e = np.arange(0, int(X/100)+1)
				f = np.arange(0, int(X/100)+1)
				DEF = np.meshgrid(d, e, f)
				Splus = 103 * DEF[0] + 104 * DEF[1] * 105 * DEF[2]
				if np.any(Splus == X - S) == True:
					return 1
	return 0

print(judge(X))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
args = sys.argv
if len(args) == 2:
  from IPython import embed
  em = True
else:
  em = False
input = sys.stdin.readline
Xs = input()
X = int(Xs)
X_ = int(Xs[-3:])
_X = int(Xs[0:-3])
if X < 100:
  print("0")
  exit()
if X_ == 0 or X_ == 1 or X_ == 2 or X_ == 3 or X_ == 4 or X_ == 5:
  print("1")
  exit()
count = 0
count += X_ // 5
X_ = X_ %  5
count += X_ //4
X_=X_%4
count += X_ //3
X_=X_%3
count += X_ //2
X_=X_%2
count += X_ //1
X_=X_%1
if _X - count >= 0:
  print("1")
else:
  print("0")
if em: sys.stdin = open('/dev/tty')

Submission status: Runtime Error

Solution code:
'''
　 ∧_,,∧    究極奥義「WAがACになーれ！！」
　（`・ω・)つ━☆・*。
　⊂　　 ノ 　　　・゜+.
　 し’´Ｊ　　*・ 
'''
import sys
input = sys.stdin.readline
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
if x<=199:
    print(dp[x])
    exit()
for i in range(200,x+1):
    if dp[i-100]==1 or dp[i-101]==1 or dp[i-102]==1 or dp[i-103]==1 or dp[i-104]==1 or dp[i-105]==1:
        dp[i]=1
print(dp[x])

Submission status: Runtime Error

Solution code:
money = [0,1,2,3,4,5]
n = int(input())
p = 0
lm = n//100
need = n - (lm*100)
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: Runtime Error

Solution code:
'''
　 ∧_,,∧    究極奥義「WAがACになーれ！！」
　（`・ω・)つ━☆・*。
　⊂　　 ノ 　　　・゜+.
　 し’´Ｊ　　*・ 
'''
import sys
input = sys.stdin.readline
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(200,x+1):
    if dp[i-100]==1 or dp[i-101]==1 or dp[i-102]==1 or dp[i-103]==1 or dp[i-104]==1 or dp[i-105]==1:
        dp[i]=1
print(dp[x])

Submission status: Runtime Error

Solution code:
def count(S, m, n): 
    table = [0 for k in range(n+1)] 
  
    table[0] = 0
      for i in range(0,m): 
        for j in range(S[i],n+1): 
            table[j] += table[j-S[i]] 
  
    return table[n] 
  
def main():
    X = int(input())
    S = [100, 101, 102, 103, 104, 105, 106] 

    if count(S, 7, X):
        print(1)
    else:
        print(0)
    
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
x = int(input())

if len(str(x)) == 3:
  mod = int(str(x)[1:])
  n = x//100
  print("1" if mod < 5*n else "0")
else:
  mod = int(str(x)[2:])
  n = int(str(x)[:2])
  print("1" if mod < 5*n else "0")

Submission status: Runtime Error

Solution code:
x = int(input())
l_len = x // 100
l_sum = x % 100
def issum(lis, l_sum, l_len, curr_sum, curr_len):
#     print(curr_sum)
    if curr_sum > l_sum or curr_len > l_len:
        return
    if curr_sum == l_sum and curr_len == l_len:
        return True
    for i in range(l_len):
        if issum(lis, l_sum, l_len, curr_sum + lis[i], curr_len + 1):
            return True
a = [0, 1, 2, 3, 4, 5]
if issum(a, l_sum, l_len, 0, 0):
  print(1)
else:
  print(0)

Submission status: Runtime Error

Solution code:
X = int(input())

ans = 0

def search(a):
    
    global ans
    
    if a > X:
        return 0
    
    if a == X:
        ans = 1
    
    search(a+100)
    search(a+101)
    search(a+102)
    search(a+103)
    search(a+104)
    search(a+105)
    
    return ans
        
print(search(0))

Submission status: Runtime Error

Solution code:
x = str(input())
lx = len(x)
num = lx - 2
head = int(x[:num])
body = int(x[num:])
up = head * 5
ans = int(0)
if body <= up:
    ans = 1
else:
    ans = 0
if int(x) > 615 * 1000000:
    ans = 0
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!python3.4.3

x_str = input()
x = int(x_str)

a = int(x_str[:-2])
b = int(x_str[-2:])

if a > b:
    print(1)
else:
    count = 0
    d = b
    for i in range(5, 0, -1):
        if d % i == 0:
            print(1)
            break
        c = d // i
        count += c
        if a < count:
            print(0)
            break
        d = d - c*i

Submission status: Runtime Error

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

def dfs(total, x):
    if total > x:
        return False

    if total == x:
        return total == x

    if dfs(total + 100, x):
        return True

    if dfs(total + 101, x):
        return True

    if dfs(total + 102, x):
        return True

    if dfs(total + 103, x):
        return True

    if dfs(total + 104, x):
        return True

    if dfs(total + 105, x):
        return True

print(1 if dfs(0, x) else 0)

Submission status: Runtime Error

Solution code:
x = str(input())
lx = len(x)
num = lx - 2
head = int(x[:num])
body = int(x[num:])
up = head * 5
ans = int(0)
if body <= up:
    ans = 1
else:
    ans = 0
if x > 615 * 1000000:
    ans = 0
print(ans)

Submission status: Runtime Error

Solution code:
X=input()
m=int(X[0])
t=int(X[1:3])
print(1 if m*5>=t or len(X)>=4 else 0)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X=int(input())
N=X//100
a=[100,101,102,103,104,105]
ans=[0]
for i in range(N):
    ans2 = []
    for j in ans:
        ans2.append(j+a[i])
        ans2.append(j)
    ans = ans2[::]
if X in ans:
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
x = str(input())
lx = len(x)
num = lx - 2
head = int(x[:num])
body = int(x[num:])
up = head * 5
if body <= up:
    print("1")
else:
    print("0")

Submission status: Runtime Error

Solution code:
n = int(input())
ni = n%100
da = n//100

for a in range(ni):
    for b in range(ni):
        for c in range(ni):
            for d in range(ni):
                for e in range(ni):
                    if a + b*2 + c*3 + d*4 + e*5 == ni :
                        break
                else:
                    continue
                break
            else:
                continue
            break
        else:
            continue
        break
    else:
        continue
    break
if a+b+c+d+e <=da:
    print("1")
else:
    print("0")

Submission status: Runtime Error

Solution code:
s = input()

n=int(s[0])
a=int(s[1]+s[2])
if a/n<5:
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
import numpy as np
x = int(input())
dp = np.zeros(x)

def cal(ar):
  tof = 0
  for i in ar:
    if i == 1:
      tof = 1
      break
  return tof

for i in range(99,105):
  dp[i] = 1
for i in range(105, x):
  dp[i] = cal(dp[i-105:i-99])
print(int(dp[x-1]))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import numpy as np
x = int(input())
dp = np.zeros(x)

def cal(ar):
  tof = 0
  for i in ar:
    if i == 1:
      tof = 1
      break
  return tof

for i in range(99,105):
  dp[i] = 1
for i in range(105, x):
  print(dp[i-105:i-99])
  dp[i] = cal(dp[i-105:i-99])
  break
print(int(dp[x-1]))

Submission status: Runtime Error

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


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

Submission status: Runtime Error

Solution code:
X=input()
m=int(X[0])
t=int(X[1:3])
print(1 if m*5>=t else 0)

Submission status: Runtime Error

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

X=input()

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

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


max_kosu=X/100
x=X%100

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

Submission status: Runtime Error

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


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

Submission status: Runtime Error

Solution code:
from functools import reduce

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

S = input()
judge(S)

Submission status: Runtime Error

Solution code:
x = int(input())
s = str(x)
s2s = ''.join(([s[-2],s[-1]]))
s2 = int(s2s)
# print(s2)

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

Submission status: Runtime Error

Solution code:
x=input()

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

Submission status: Runtime Error

Solution code:
X = int(input())

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

Submission status: Runtime Error

Solution code:
X = int(raw_input())

nmax = 100000

array = [0]*nmax
array[0] = 1

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

for i in range(nmax):
    for value in value_list:
        if i - value >= 0:
            if array[i-value] == 1:
                array[i] = 1

print array[X]

Submission status: Runtime Error

Solution code:
import numpy as np
x = int(input())
dp = np.zeros(x)

def cal(ar):
  tof = 0
  for i in ar:
    if i == 1:
      tof = 1
      break
  return tof
dp[0] = 1
for i in range(99,105):
  dp[i] = 1
for i in range(105, x):
  dp[i] = cal(dp[i-105:i-99])
print(int(dp[x-1]))

Submission status: Runtime Error

Solution code:
x = int(input())
dic = {0: 100, 1:101, 2:102, 3:103, 4:104, 5:105}
global ans
ans = 0
def dfs(i, v):
  global ans
  if v == x:
    ans = 1
    return

  if v > x:
    return
  
  for k in range(6):
    dfs(k, v+dic[k])

  return 

dfs(0, 0)
if ans == 1:
  print(1)
else:
  print(0)