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:
n = int(input())
s = input()
seq = list(set(list(s)))
genkai_list = []
for i in range(0,1000):
    if 0 <= i <= 9:
        ap = "00" + str(i)
        genkai_list.append(ap)
    elif 10 <= i <= 99:
        ap = "0" + str(i)
        genkai_list.append(ap)
    else:
        genkai_list.append(str(i))
ans = []
for a in range(len(genkai_list)):
    for i in range(len(s)):
        if s[i] == genkai_list[a][0]:
            for j in range(i + 1, len(s)):
                if s[j] == genkai_list[a][1]:
                    for k in range(j + 1, len(s)):
                        if s[k] == genkai_list[a][2]:
                            ans.append(a)
                            break # break1
                    else:  # break1されなかった場合
                        continue
            else:
                continue # jのループが全部回った（2文字目で一致しなかった）ら、iを次の文字に
    else:
        continue # iのループが全部回った（1文字目で一致しなかった）ら、aを次の文字に
                
print(len(set(ans)))

Submission status: Runtime Error

Solution code:
from functools import lru_cache

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

Solution code:
n=int(input())
boo=[0 for i in range(10**5+1)]
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: Runtime Error

Solution code:
n=int(input())
boo=[0 for i in range(10**5+1)]
boo[100]=1
boo[101]=1
boo[102]=1
boo[103]=1
boo[104]=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: Runtime Error

Solution code:
X = int(input())

num_list = [0]*100001
num_list[0] = 1

for i in range(100001 + 1 + 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: Runtime Error

Solution code:
X = int(input())

num_list = [0]*100000
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: Runtime Error

Solution code:
X = int(input())

num_list = [0]*100000
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

Submission status: Runtime Error

Solution code:
from functools import reduce
from operator import add
X = int(input())
if X < 100: print(0)
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: Runtime Error

Solution code:

N = int(input())
S = input()
ans = 0
anslst = []
for i in range(10):
    for j in range(10):
        for k in range(10):
            anslst.append(str(i) + str(j) + str(k))

tmp = ans
for i in anslst:
    for j in range(N):
        if i[0] == S[j]:
            for k in range(j + 1, N):
                if i[1] == S[k]:
                    for n in range(k + 1, N):
                        if i[2] == S[n]:
                            ans += 1
                            break
                    break
        if tmp != ans:
            tmp = ans
            break
print(ans)

Submission status: Runtime Error

Solution code:
x = int(input())
key = [True] + [False]*99 + [True]*6 + [0]*(x+1)
def dp(x):
    if x <= 105:
        return key[x]
    if key[x] == 0:
        key[x] = any([dp(x-100), dp(x-101), dp(x-102), dp(x-103), dp(x-104), dp(x-105)])
    return key[x]
if dp(x):
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
def check(x, num):
  if x == 0:
    return 1
  if(check(x-num, 100) == 1):
    return 1
  if(check(x-num, 101) == 1):
    return 1
  if(check(x-num, 102) == 1):
    return 1
  if(check(x-num, 103) == 1):
    return 1
  if(check(x-num, 104) == 1):
    return 1
  if(check(x-num, 105) == 1):
    return 1
  return 0
  
###########
X = int(input())

#print(X)
if (X >= 2000):
  print(1)
else:
  print(check(X,0))

Submission status: Runtime Error

Solution code:
x = int(input())
key = [True] + [False]*99 + [True]*6 + [0]*(x+1)
def dp(x):
    if key[x] == 0:
        key[x] = any([dp(x-100), dp(x-101), dp(x-102), dp(x-103), dp(x-104), dp(x-105)])
    return key[x]
if dp(x):
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
x = int(input())
key = [0]*(x+1)
def dp(x):
    if x == 0:
        key[x] = 0
        return True
    if x < 100:
        key[x] = False
        return False
    if key[x] == 0:
        key[x] = any([dp(x-100), dp(x-101), dp(x-102), dp(x-103), dp(x-104), dp(x-105)])
        return key[x]
if dp(x):
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
x = int(input())
def dp(x):
    if x == 0:
        return True
    if x < 100:
        return False
    return any([dp(x-100), dp(x-101), dp(x-102), dp(x-103), dp(x-104), dp(x-105)])

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

Submission status: Runtime Error

Solution code:
import itertools

N = int(input())
num = [100,101,102,103,104,105]
p = itertools.permutations(num, 5)



if X < 100:
    print(0)
else:
    ret = 0
    M = []
    for i in range(1, 6):
        c = itertools.combinations(num, i)
        for j in c:
            ret = sum(j)
            M.append(ret)

    ans = 0

    for i in num:
        if N % i == 0:
            ans = 1
            break
        if N % i in M:
            ans = 1
            break
        for j in M:
            if (N%i)%j == 0:
                ans = 1
        
        
    r = N
    for i in M:
        r = r - i
        if r in M:
            ans = 1
            break

    print(ans)

Submission status: Runtime Error

Solution code:
def check(x, num):
  if x == 0:
    return 1
  if x >= 100:
    if(check(x-num, 100) == 1):
      return 1
  if x >= 101:
    if(check(x-num, 101) == 1):
      return 1
  if x >= 102:
    if(check(x-num, 102) == 1):
      return 1
  if x >= 103:
    if(check(x-num, 103) == 1):
      return 1
  if x >= 104:
    if(check(x-num, 104) == 1):
      return 1
  if x >= 105:
    if(check(x-num, 105) == 1):
      return 1
  return 0
  
###########
X = int(input())

#print(X)

print(check(X,0))

Submission status: Runtime Error

Solution code:
def check(x, num):
  if x == 0:
    return 1
  if x >= 100:
    if(check(x-num, 100) == 1):
      return 1
  if x >= 101:
    if(check(x-num, 101) == 1):
      return 1
  if x >= 102:
    if(check(x-num, 102) == 1):
      return 1
  if x >= 103:
    if(check(x-num, 103) == 1):
      return 1
  if x >= 104:
    if(check(x-num, 104) == 1):
      return 1
  if x >= 105:
    if(check(x-num, 105) == 1):
      return 1
  return 0
  
###########
X = int(input())

print(X)

print(check(X,0))

Submission status: Runtime Error

Solution code:
# 2019 12/01
# C 100 to 105


# def rec(x, N):
#     if x <= 5:
#         return 1
#     if rec(x-1, N-1) == 1:


COST = {0, 1, 2, 3, 4, 5}
X = int(input())
upper = X // 100
lower = X // 105

# print(lower, upper)

dp = [[0 for j in range(0, X - 100 * lower + 1)] for i in range(upper + 1)]
for i in range(0, 6):
    dp[1][i] = 1

for i in range(2, upper + 1):
    for j in range(0, X - 100 * lower + 1):
        if dp[i-1][j] == 1:
            dp[i][j] = 1
        elif ((dp[i-1][j-1]==1)or(dp[i-1][j-2]==1)or
              (dp[i-1][j-3]==1)or(dp[i-1][j-4]==1)or(dp[i-1][j-5]==1)):
            dp[i][j] = 1


for i in range(lower, upper+1):
    sub = X - 100 * i
    #print(sub, i)
    if dp[i][sub] == 1:
        print(1)
        exit()
    else:
        continue

print(0)

Submission status: Runtime Error

Solution code:
import math

N = input()
kami = int(N[:-2])
shimo = int(N[-2:])
shimo_org = int(N[-2:])

counters = [0] * 5

for i in range(0,5):
    j = 5 - i
    counters[i] = math.floor(shimo / j)
    shimo -= counters[i] * j

if shimo_org == 0:
    print(1)
elif sum(counters) <= int(kami):
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
# 2019 12/01
# C 100 to 105


# def rec(x, N):
#     if x <= 5:
#         return 1
#     if rec(x-1, N-1) == 1:


COST = {0, 1, 2, 3, 4, 5}
X = int(input())
upper = X // 100
lower = X // 105

# print(lower, upper)

dp = [[0 for j in range(0, X - 100 * lower + 1)] for i in range(upper + 1)]
for i in range(0, 6):
    dp[1][i] = 1

for i in range(2, upper + 1):
    for j in range(0, X - 100 * lower + 1):
        if dp[i-1][j] == 1:
            dp[i][j] = 1
        elif ((dp[i-1][j-1]==1)or(dp[i-1][j-2]==1)or
              (dp[i-1][j-3]==1)or(dp[i-1][j-4]==1)or(dp[i-1][j-5]==1)):
            dp[i][j] = 1


for i in range(lower, upper+1):
    sub = X - 100 * i
    # print(sub, i)
    if dp[i][sub] == 1:
        print(1)
        exit()
    else:
        print(0)

Submission status: Runtime Error

Solution code:
# 2019 12/01
# C 100 to 105


# def rec(x, N):
#     if x <= 5:
#         return 1
#     if rec(x-1, N-1) == 1:


COST = {0, 1, 2, 3, 4, 5}
X = int(input())
upper = X // 100
lower = X // 105

# print(lower, upper)

dp = [[0 for j in range(0, X - 100 * lower + 1)] for i in range(upper + 1)]
for i in range(0, 6):
    dp[1][i] = 1

for i in range(2, upper + 1):
    for j in range(0, X - 100 * lower + 1):
        if dp[i-1][j] == 1:
            dp[i][j] = 1
        elif ((dp[i-1][j-1]==1)or(dp[i-1][j-2]==1)or
              (dp[i-1][j-3]==1)or(dp[i-1][j-4]==1)or(dp[i-1][j-5]==1)):
            dp[i][j] = 1


for i in range(lower, upper+1):
    sub = X - 100 * i
    # print(sub, i)
    if dp[i][sub] == 1:
        print(1)
    else:
        print(0)

Submission status: Runtime Error

Solution code:
X = int(input())

flag = 0
n = X // 100
left = X - 100*n

if left == 0:
    print(1)

if left > 5*n:
    print(0)


else:   
    for i_1 in range(n+1)
        for i_2 in range(n+1-i_1):
            num = 0
            num += 5*i_2

            if num > left:
                flag = 2
                break

            for i_3 in range(n+1 - i_2-i_1):
                num += 4*i_3

                if num > left:
                    flag = 2
                    break

                for i_4 in range(n+1 - i_2 - i_3-i_1):
                    num += 3*i_4

                    if num > left:
                        flag = 2
                        break

                    for i_5 in range(n+1 - i_2 - i_3 - i_4-i_1):
                        num += 2*i_5

                        if num > left:
                            flag = 2
                            break

                        for i_6 in range(n+1 - i_2 - i_3 - i_4 - i_5-i_1):
                            num += 1*i_6

                            if num == left:
                                flag = 1
                                break

                            if num > left:
                                flag = 2
                                break

                        if flag == 1 or flag == 2:
                            break
                    if flag == 1 or flag == 2:
                        break
                if flag == 1 or flag == 2:
                    break
            if flag == 1 or flag == 2:
                break
                

                        


    print(1 if flag == 1 else 0)

Submission status: Runtime Error

Solution code:
n = int(input())
if n % 615 == 0:
	print(1)
else:
	if n%100 == 0 or n%101==0 or n%102 == 0 or n%103==0 or n%104==0 or n%105==0:
		print(1)
	elif n% 209 == 0 n%206==0 or n%207==0 or n%208==0 or n%201 ==0 or n%202 == 0 or n%203==0 or n%204 == 0 or n%205 == 0:
		print(1)
	elif n%303 == 0 or n% n%304 ==0 or n%305 == 0 or n%306 == 0 or n%307==0 or n%308==0 or n%309==0 or n%310 == 0 or n%311==0 or n%312==0:
		print(1)
	elif n%406==0 or n%407==0 or n%408==0 or n%409==0 or n%410==0 or n%411==0 or n%412==0 or n%413==0 or n%414==0:
		print(1)
	elif n%510==0 or n%511==0 or n%512==0 or n%513==0 or n%514==0 or n%515==0:
		print(1)
	else:
		print(0)

Submission status: Runtime Error

Solution code:
def check(x, num):
  if x >= 100:
    if(check(x-num, 100) == 1):
      return 1
  if x >= 101:
    if(check(x-num, 101) == 1):
      return 1
  if x >= 102:
    if(check(x-num, 102) == 1):
      return 1
  if x >= 103:
    if(check(x-num, 103) == 1):
      return 1
  if x >= 104:
    if(check(x-num, 104) == 1):
      return 1
  if x >= 105:
    if(check(x-num, 105) == 1):
      return 1
  return 0
  
###########
X = int(input())

#print(X)

print(check(X,0))

Submission status: Runtime Error

Solution code:
X = int(input())

flag = 0
n = X // 100
left = X - 100*n

if left == 0
    print(1)

if left > 5*n:
    print(0)


else:   
    for i_1 in range(n+1)
        for i_2 in range(n+1-i_1):
            num = 0
            num += 5*i_2

            if num > left:
                flag = 2
                break

            for i_3 in range(n+1 - i_2-i_1):
                num += 4*i_3

                if num > left:
                    flag = 2
                    break

                for i_4 in range(n+1 - i_2 - i_3-i_1):
                    num += 3*i_4

                    if num > left:
                        flag = 2
                        break

                    for i_5 in range(n+1 - i_2 - i_3 - i_4-i_1):
                        num += 2*i_5

                        if num > left:
                            flag = 2
                            break

                        for i_6 in range(n+1 - i_2 - i_3 - i_4 - i_5-i_1):
                            num += 1*i_6

                            if num == left:
                                flag = 1
                                break

                            if num > left:
                                flag = 2
                                break

                        if flag == 1 or flag == 2:
                            break
                    if flag == 1 or flag == 2:
                        break
                if flag == 1 or flag == 2:
                    break
            if flag == 1 or flag == 2:
                break
                

                        


    print(1 if flag == 1 else 0)

Submission status: Runtime Error

Solution code:
n = int(input())
if n % 615 == 0:
	print(1)
else:
	if n%100 == 0 or n%101==0 or n%102 == 0 or n%103==0 or n%104==0 or n%105==0:
		print(1)
	elif n%206==0 or n%207==0 or n%208==0 or n%201 ==0 or n%202 == 0 or n%203==0 or n%204 == 0 or n%205 == 0:
		print(1)
	elif n%303 == 0 or n% n%304 ==0 or n%305 == 0 or n%306 == 0 or n%307==0 or n%308==0 or n%309==0 or n%310 == 0 or n%311==0 or n%312==0:
		print(1)
	elif n%406==0 or n%407==0 or n%408==0 or n%409==0 or n%410==0 or n%411==0or n%412==0 or n%413==0 or n%414==0:
		print(1)
	elif n%510==0or n%511==0 or n%512==0 or n%513==0 or n%514==0 or n%515==0:
		print(1)
	else:
		print(0)

Submission status: Runtime Error

Solution code:
X = int(input())
x = X%2100
c = 0
for i in range(1,21):
    if int(x//100) == i:
        if x%100  <= i*5:
            c=1
        else:
            continue
if x = 2100:
    c=1
print(c)

Submission status: Runtime Error

Solution code:
int(input())

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

Submission status: Runtime Error

Solution code:
nt(input())

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

Submission status: Runtime Error

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

if n < 99:
    print(0)
    sys.exit()
'''
for i,j in enumerate(str(n)):
    if i != 0 and j!=0:
        ans = i
        break
m = int(str(n)[ans:])
'''
@lru_cache(maxsize=10000)
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(100,n,depth,count)
    r2 = judge(101,n,depth,count)
    r3 = judge(102,n,depth,count)
    r4 = judge(103,n,depth,count)
    r5 = judge(104,n,depth,count)
    r6 = judge(105,n,depth,count)
    return max(max(r1,r2),max(max(r3,r4),max(r5,r6)))

print(judge(0,n,depth,0))

Submission status: Runtime Error

Solution code:
X=input()
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 2100<int(X):
    print(1)
elif sum_>int(X):
    print(0)
else:
    print(1)

Submission status: Runtime Error

Solution code:
f = list(input())

h = ''.join(f)
del f[0]
r = int(''.join(f))
g = [5, 4, 3, 2, 1]
count = [0] * 5

def ui(o):
    global g, r, count
    u = 0
    for j in range(int(o)):
        u = 0
        for i in g:
            if r>=i and u == 0 and not(r==0):
                count[i-1] += 1
                r -= i
                u = 1


ui(h[0])
ans = 0
for i in range(5):
    if count[i] > 1000000:
        print(0)
        exit()
    ans += (100 + (i + 1))*count[i]
if (int(''.join(h)) - ans) % 100 == 0:
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
import sys
n = int(input())
if n%105==0 or n%104==0 or n%103==0 or n%102==0 or n%101==0 or n%100==0:
	print('1')
    sys.exit()

ans = n%615
if ans < 100:
  ans+=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 ans < tmp:break
print('0')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
for a in range(500):
    for b in range(500-100*a):
        for c in range(500-100*a-101*b):
            for d in range(500-100*a-101*b-102*c):
                for e in range(500-100*a-101*b-102*c-103*d):
                    for f in range(500--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: Runtime Error

Solution code:
X=input()
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: Runtime Error

Solution code:
import sys
from functools import lru_cache
n = int(input())
depth = n//100
if n%100 == 0:
    print(1)
    sys.exit()
if n > 90000:
    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:])
'''
@lru_cache(maxsize=10000)
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(100,n,depth,count)
    r2 = judge(101,n,depth,count)
    r3 = judge(102,n,depth,count)
    r4 = judge(103,n,depth,count)
    r5 = judge(104,n,depth,count)
    r6 = judge(105,n,depth,count)
    return max(max(r1,r2),max(max(r3,r4),max(r5,r6)))

print(judge(0,n,depth,0))

Submission status: Runtime Error

Solution code:
import sys
from functools import lru_cache
n = int(input())
depth = n//100
if n%100 == 0:
    print(1)
    sys.exit()
if n > 90000:
    print(0)
    sys.exit()
'''
for i,j in enumerate(str(n)):
    if i != 0 and j!=0:
        ans = i
        break
m = int(str(n)[ans:])
'''
@lru_cache(maxsize=10000)
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(100,n,depth,count)
    r2 = judge(101,n,depth,count)
    r3 = judge(102,n,depth,count)
    r4 = judge(103,n,depth,count)
    r5 = judge(104,n,depth,count)
    r6 = judge(105,n,depth,count)
    return max(max(r1,r2),max(max(r3,r4),max(r5,r6)))

print(judge(0,n,depth,0))

Submission status: Runtime Error

Solution code:
f = list(input())

h = ''.join(f)
del f[0]
r = int(''.join(f))
g = [5, 4, 3, 2, 1]
count = [0] * 5

def ui(o):
    global g, r, count
    u = 0
    for j in range(int(o)):
        u = 0
        for i in g:
            if r>=i and u == 0 and not(r==0):
                count[i-1] += 1
                r -= i
                u = 1


ui(h[0])
ans = 0
for i in range(5):
    if count[i] > 1000000:
        print(0)
        exit()
    ans += 100 + count[i] * (i + 1)
if (int(''.join(h)) - ans) % 100 == 0:
    print(1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
n=int(input())
a=n%100
for i in range(a):
  for j in range(a-i):
    for k in range(a-i-j):
      for l in range(a-i-j-k):
        for m in range(a-i-j-k-l):
          if i+2*j+3*k+4*l+5*m == a:
            print(1)
            return
print(0)

Submission status: Runtime Error

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

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

    if cnt<=N:
        flag = False
        print(1)
    
    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: Runtime Error

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

Xlist = str(X)

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

Submission status: Runtime Error

Solution code:
import sys
from functools import lru_cache
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:])
'''
@lru_cache(maxsize=10000)
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(100,n,depth,count)
    r2 = judge(101,n,depth,count)
    r3 = judge(102,n,depth,count)
    r4 = judge(103,n,depth,count)
    r5 = judge(104,n,depth,count)
    r6 = judge(105,n,depth,count)
    return max(max(r1,r2),max(max(r3,r4),max(r5,r6)))

print(judge(0,n,depth,0))

Submission status: Runtime Error

Solution code:
import itertools
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: Runtime Error

Solution code:
g

Submission status: Runtime Error

Solution code:
import sys
from functools import lru_cache

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:])
'''

@lru_cache(maxsize=1000)
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(100,n,depth,count)
    r2 = judge(101,n,depth,count)
    r3 = judge(102,n,depth,count)
    r4 = judge(103,n,depth,count)
    r5 = judge(104,n,depth,count)
    r6 = judge(105,n,depth,count)
    return max(max(r1,r2),max(max(r3,r4),max(r5,r6)))
 
print(judge(0,n,depth,0))

Submission status: Runtime Error

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

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

    if cnt<=N:
        flag = False
        print(1)
    
    return flag

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)

Submission status: Runtime Error

Solution code:
import sys
from functools import lru_cache
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:])
'''
@lru_cache(maxsize=1000)
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(100,n,depth,count)
    r2 = judge(101,n,depth,count)
    r3 = judge(102,n,depth,count)
    r4 = judge(103,n,depth,count)
    r5 = judge(104,n,depth,count)
    r6 = judge(105,n,depth,count)
    return max(max(r1,r2),max(max(r3,r4),max(r5,r6)))

print(judge(0,n,depth,0))

Submission status: Runtime Error

Solution code:
f = list(input())

h = ''.join(f)
del f[0]
r = int(''.join(f))
g = [5, 4, 3, 2, 1]
count = [0] * 5

def ui(o):
    global g, r, count
    u = 0
    for j in range(int(o)):
        u = 0
        #print(j)
        #print("j")
        #print(r)
        for i in g:
            #print(i)
            if (r / (i + 1)) % 1 == 0 and u == 0 and not(r==0):
                #print(r,i)
                count[i] += 1
                r -= i + 1
                u = 1


ui(h[0])
ans = 0
for i in range(5):
    if count[i] > 1000000:
        print(0)
        exit()
    ans += 100 + count[i] * (i + 1)
#print(ans)
if (int(''.join(h)) - ans) % 100 == 0:
    print(1)
else:
    print(0)
#print(count)
#print(h[0])
#print(h)

Submission status: Runtime Error

Solution code:
list = [100,101,102,103,104,105]

def search(list, target):
    for i in list:
        target = target - i
        if target == 0:
            return True
        elif target <= 0:
            return
        else:
            search(list,target)

s = search(list,int(input()))

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

Submission status: Runtime Error

Solution code:
import numpy as np

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

N = len(a1) - 1
elm = []
for i, step in enumerate(a1):
    temp = [1] * (N - i)
    elm.append(np.arange(0, t+1, step).reshape(-1, *temp))
 
res = 0
ans = []
for x in elm:
    res = res + x
 
for x in np.argwhere(res == t):
    ans = x

if len(ans)==0:
  print(0)
else:
  print(1)

Submission status: Runtime Error

Solution code:
X = int(input())

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

pre_list = []
sum_value = 0
for i in range(1, 1001):
    tmp_list = []
    for value in item_list:
        tmp_list.append(i * value)
    
    pre_list.append(tmp_list)

sum_list = [[0] * 7 for i in range(1001)]
for i in range(1000):
    for j in range(6):
            sum_list[i + 1][j + 1] = sum_list[i][j + 1] + sum_list[i + 1][j] - sum_list[i][j] + pre_list[i][j]

flag = 0
for i1 in range(0, 1000):
    for i2 in range(i1+1, 1001):
        for j1 in range(0, 6):
            for j2 in range(j1+1, 7):
                    value = sum_list[i2][j2] - sum_list[i1][j2] - sum_list[i2][j1] + sum_list[i1][j1]  
                if X == value:
                    flag = 1

print(flag)

Submission status: Runtime Error

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

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

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

if X < 100:
    ans = 0
elif:
    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:
X = int(input())
flag=False

if X>=2000:
  print(1)
else:
  for i in range(0,21):
    for j in range(0,21-i):
      for k in range(0,21-i-j):
        for l in range(0,21-i-j-k):
          for m in range(0,21-i-j-k-l):
            for n in range(0,21-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: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
x = int(input())

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

Submission status: Runtime Error

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

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

    if cnt<=N:
        flag = False
        print(1)
    
    return flag

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)

Submission status: Runtime Error

Solution code:
x = input()
n = int(x[0]) * 5
k = int(x[1:3])
if k <= n:
    print(1)
else:
    print(0)

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 or X_b <= X_b*5:
  print(1)
else:
  print(0)