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: Wrong Answer

Solution code:
x = input()
l = len(x)

if (l >= 3):
    a = int(x[0]) * 10 ** (l - 1);
    b = int(x) - a;
    if (a < 20 * b):
        print(0)
    else:
        print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
X = int(input())
N = 1000
size = 6

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

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


sum_list = [[0] * (size + 1) for i in range(N + 1)]
for i in range(N):
    for j in range(size):
            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(N):
    for i2 in range(i1 + 1, N + 1):
        for j1 in range(size):
            for j2 in range(j1 + 1, size + 1):
                value = sum_list[i2][j2] - sum_list[i1][j2] - sum_list[i2][j1] + sum_list[i1][j1]  
                if X == value:
                    flag = 1
                    break

print(flag)

Submission status: Wrong Answer

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

kosu_max = x // 100

amari = x - kosu_max * 100


# print(amari, kosu_max)

if x < 100:
    print(0)

if amari <= kosu_max * 5:
    print(1)

# kosu_max = x // 100
# kosu_min = x // 105
#
# # print(kosu_min, kosu_max)
# #
# print(x - kosu_min * 105, x - kosu_max * 100)
#
# # print(kosu_min*5, kosu_max*5)
# #
# # if kosu_max*5 <= x-kosu_max*100 and kosu_min*5 <= x-kosu_min*105:
# #     print('0')
# # else:
# #     print('1')

Submission status: Wrong Answer

Solution code:
import itertools
 
X = int(input())
pd = (101,102,103,104,105)
count = int(X / 101)
ans = 0
if X > 100:
  for i in itertools.combinations_with_replacement(pd,count):
      if sum(i) == X:
          ans = 1
          break
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

main()

Submission status: Wrong Answer

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
                    break

if X >= 2000:
    flag = 1

print(flag)

Submission status: Wrong Answer

Solution code:
import itertools
 
X = int(input())
pd = (101,102,103,104,105)
count = int(X / 101)
ans = 0
if X < 100:
  for i in itertools.combinations_with_replacement(pd,count):
      if sum(i) == X:
          ans = 1
          break
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import itertools

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



if N < 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: Wrong Answer

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

for a in range(2001):
    for b in range(2001-100*a):
        for c in range(2001-100*a-101*b):
            for d in range(2001-100*a-101*b-102*c):
                for e in range(2001-100*a-101*b-102*c-103*d):
                    for f in range(2001-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: Wrong Answer

Solution code:
import itertools

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

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: Wrong Answer

Solution code:
# coding: utf-8

x = str(bin(int(input())))

number = x.count("1")

if number%2 == 0:
    print("1")
else:
    print("0")

Submission status: Wrong Answer

Solution code:
import itertools
import sys

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

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
        print(ans)
        sys.exit()

rr = N
for i in p:
    for j in i:
        rr = rr % j
        if rr == 0:
            ans = 1
            print(ans)
            sys.exit()

r = N
for i in M:
    r = r - i
    if r in M:
        ans = 1
        break

print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

s = X//100
t = X%100


ans=0
for i in range(1,s+1):
  ans+=0*i
  for j in range(1,s+1-i):
    ans+=1*j
    for k in range(1,s+1-i-j):
      ans+=2*k
      for l in range(1,s+1-i-j-k):
        ans+=3*l
        for m in range(1,s+1-i-j-k-l):
          ans+=4*m
          for n in range(1,s+1-i-j-k-l-m):
            ans+=5*n
            if ans == t:
              print(1)
              exit()
print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())

num = []

for i in range(100):
    addnum = list(range(100 * i, 100 * i + 5 * i + 1))
    num += addnum

if x < 100 or x > 10000:
    print(1)
elif x in num:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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 or 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)
	else:
		print(0)

Submission status: Wrong Answer

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

if n < 99:
    print(0)
    sys.exit()
if n > 50000:
    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=100000)
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: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
import itertools

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

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


r = N
for i in M:
    r = r - i
    if r in M:
        ans = 1
        break

print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

num = []

for i in range(100):
    addnum = list(range(100 * i, 100 * i + 5 * i + 1))
    num += addnum

if x < 100 or x > 20000:
    print(1)
elif x in num:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import math

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


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

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
x = int(input())

n = x // 100 + 1
flag = False

for a in range(n):
    for b in range(n - a):
        if b >= 0:
            for c in range(n - b):
                if c >= 0:
                    for d in range(n - c):
                        if d >= 0:
                            for e in range(n - d):
                                if e >= 0:
                                    val = x - a * 100 - b * 101 - c * 102 - d * 103 - e * 104 - (
                                            n - a - b - c - d - e) * 105
                                    if val == 0:
                                        flag = True
                                        break
                            if flag:
                                break
                    if flag:
                        break
            if flag:
                break
    if flag:
        break

print(1) if flag else print(0)

Submission status: Wrong Answer

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 or 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: Wrong Answer

Solution code:

def main():
    n = 6
    a=[100,101,102,103,104,105]
    k = int(input())


    def dfs(i, sum_):
        if i == n:
            return sum_ == k

        if dfs(i + 1, sum_):
            return True

        if dfs(i + 1, sum_ + a[i]):
            return True

        return False

    def solve():
        if dfs(0, 0):
            print('1')
        else:
            print('0')

    solve()
main()

Submission status: Wrong Answer

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

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

min_=N//105
max_= N//100 + 1
#print(min_,max_)
count=0
for m in range(min_,max_):
    X = N - 100*m
    for i in range(0,X+1):
        for j in range(0,(X-i)//2 +1):
            for k in range(0,(X-i-2*j)//3 +1):
                for l in range(0,(X-i-2*j-3*k)//4 +1):
                    count+=1
                    if count >= 10**6:
                        print(0)
                        sys.exit()
                    temp = (X-i-2*j-3*k-4*l)
                    if (temp % 5 == 0) and (m-i-j-k-l-temp//5>=0):
                        a=m-i-j-k-l-temp//5
                        t=temp // 5
                        print(1)
                        #print(N,m,a,i,j,k,l,t,100*a+101*i+102*j+103*k+104*l+105*t)
                        sys.exit()
else:
    print(0)

Submission status: Wrong Answer

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

if n < 99:
    print(0)
    sys.exit()
if n > 80000:
    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=100000)
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: Wrong Answer

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

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

min_=N//105
max_= N//100 + 1
#print(min_,max_)
count=0
for m in range(min_,max_):
    X = N - 100*m
    for i in range(0,X+1):
        for j in range(0,(X-i)//2 +1):
            for k in range(0,(X-i-2*j)//3 +1):
                for l in range(0,(X-i-2*j-3*k)//4 +1):
                    count+=1
                    if count >= 10**5:
                        print(0)
                        sys.exit()
                    temp = (X-i-2*j-3*k-4*l)
                    if (temp % 5 == 0) and (m-i-j-k-l-temp//5>=0):
                        a=m-i-j-k-l-temp//5
                        t=temp // 5
                        print(1)
                        #print(N,m,a,i,j,k,l,t,100*a+101*i+102*j+103*k+104*l+105*t)
                        sys.exit()
else:
    print(0)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:

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

for a in range(1001):
    for b in range(1001-100*a):
        for c in range(1001-100*a-101*b):
            for d in range(1001-100*a-101*b-102*c):
                for e in range(1001-100*a-101*b-102*c-103*d):
                    for f in range(1001-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: Wrong Answer

Solution code:
import math

x = int(input())
flg = 0

mod = x % 2
if mod == 0:
  flg = 1

mod = x % 3
if mod == 0:
  flg = 1

mod = x % 4
if mod == 0:
  flg = 1

mod = x % 5
if mod == 0:
  flg = 1

print(flg)

Submission status: Wrong Answer

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

N = int(input())

def part_sum(a,A):
  p=10**9+7
  #初期化
  N=len(a)
  dp=[[0 for i in range(A+1)] for j in range(N+1)]
  dp[0][0]=1

  #DP
  for i in range(N):
    for j in range(A+1):
      if a[i]<=j: #i+1番目の数字a[i]を足せるかも
        dp[i+1][j]=dp[i][j-a[i]]+ dp[i][j]% p
      else: #入る可能性はない
        dp[i+1][j]=dp[i][j]%p
  return dp[N][A]

print(part_sum(list,N))

Submission status: Wrong Answer

Solution code:
x = int(input())

num = []

for i in range(21):
    addnum = list(range(100 * i, 100 * i + 5 * i + 1))
    num += addnum

if x < 100 or x > 2000:
    print(1)
elif x in num:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
x1 = int(str(x)[-2:])
if 100 <= x and x1 == 0:
    print(1)
    exit(0)
a,b = divmod(x1, 5)
s = (105*a)+(100+b) 
if s <= x:
    print(1)
    exit(0)
print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())

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

def dfs(i, sum):
    if(i == 6):
        if(sum != 0):
            return x % sum == 0
        else:
            return sum == x
    
    if (dfs(i + 1, sum)):
        return True

    if(dfs(i+1, sum + a[i])):
        return True

    return False

if(dfs(0,0)):
    print('1')
    exit()
print('0')

Submission status: Wrong Answer

Solution code:
X = int(input())
items = range(0, 6)

lim = (X % 1000) - (X % 100)
lim = lim//100


def cal(x, b, c):
    if c > lim:
        return 0

    if x == 0:
        if c == lim:
            print(1)
            exit()
        else:
            return 0

    for i in items[b::]:
        if x >= i:
            cal(x-i, i, c+1)
        else:
            break

    return 0


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

print(cal(X % 100, 0, 0))

Submission status: Wrong Answer

Solution code:
X = int(input())

num = 1000000
check = False
now = 0

for a in range(1000000):
    now = 100*(a+1)
    if now > X:
        continue

    for b in range(1000000):
        now += 101*(b+1)
        if now > X:
            continue

        for c in range(1000000):
            now += 102 * (c + 1)
            if now > X:
                continue

            for d in range(1000000):
                now += 103 * (d + 1)
                if now > X:
                    continue

                for e in range(1000000):
                    money = 100*(a+1)+101*(b+1)+102*(c+1)+103*(d+1)+104*(e+1)
                    rest = X - money
                    if money + rest != X or rest < 0:
                        continue
                    else:
                        print("1")
                        check = True
                        print(a+1,b+1,c+1,d+1,e+1,rest)
                        break

                if check == True:
                    break
            if check == True:
                break
        if check == True:
            break

    if check == True:
        break




if check == False:
    print("0")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
def main():
    n = 6
    a=[100,101,102,103,104,105]
    k = int(input())


    def dfs(i, sum_):
        if i == n:
            return sum_ == k

        if dfs(i + 1, sum_):
            return True

        if dfs(i + 1, sum_ + a[i]):
            return True

        # a[i] を使う使わないに拘らずkが作れないのでFalseを返す
        return False

    def solve():
        if dfs(0, 0):
            print('1')
        else:
            print('0')

    solve()
main()

Submission status: Wrong Answer

Solution code:
import math as ms

shina_list = [100,101,102,103,104,105]
shina_max = 1000000
allmax = 0
allmin = 100
valmin = 2100
valn = 20
for shina in shina_list:
    allmax += shina * shina_max
    
# print(allmax)
    
    
X = int(input())

ans = 0

if X < 100:
    ans = 0
elif X > allmax:
    ans = 0
else:
    if X > valmin:
        ans = 1
    else:
        xx = X / 105
        if xx.is_integer():
            n = xx
        else:
            n = ms.floor(X / 105) + 1
        stx = str(X)
        lx = len(stx)
        m = lx -2
        keta2 = int(stx[m:])
        
        if keta2 < 5 * n:
            ans = 1
        else:
            ans = 0

print(ans)

Submission status: Wrong Answer

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==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: Wrong Answer

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
                    break

print(flag)

Submission status: Wrong Answer

Solution code:
x = int(input())

a = x // 10
b = (x - a)

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

Submission status: Wrong Answer

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 == 0:
    c=1
print(c)

Submission status: Wrong Answer

Solution code:
x = int(input())


temp1 = x//100
temp2 = x%100
ans = 0
for i in range(1,6):
  sho = temp2//i
  amari = temp2%i
  if sho <= temp1 and amari <= temp1:
    ans=1
    break
print(ans)

Submission status: Wrong Answer

Solution code:
import itertools

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

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

r = N
for i in M:
    r = r - i
    if r in M:
        print(1)
        break
else:
    print(0)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import itertools
X = int(stdin.readline().rstrip())

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

tmp_list = []
for i in range(1,5+1):
    tmp = [sum(m) for m in itertools.combinations(item, i)]
    tmp_list.append(tmp)
res = list(itertools.chain.from_iterable(tmp_list))
res.append(615)
a = [X%i for i in res]

if 0 in a:
    print('1')
else:
    while any([l > 100  for l in a]):
        a = [i for i in a if i > 100]
        s = []
        for j in item:
            t = [i%j for i in a]
            s.append(t)
        a = list(itertools.chain.from_iterable(s))
    if 0 in a:
        print('1')
    else:
        print('0')

Submission status: Wrong Answer

Solution code:
X = int(input())
# 100 * 21 = 105 * 20, が最大の可換性であり，基本的にはあり得る組み合わせは非常に少ない.それ以外は
# 100 * 26 = 104 * 25, 100 * 101 = 101 * 100,これとかはありえない,100*51 = 102 * 50,とかはありえる
#100000/100 = 1000せいぜい商品の合計は1000子である10^3ならば10^3 ６回ループ回してもOK10^18になるけど?
import sys

for a in range(1001): # aだけは1000の場合がありうるわ
    for b in range(1000):
        for c in range(1000):
            for d in range(1000):
                for e in range(1000):
                    for f in range(1000):
                        price = a*100 + b*101 + c*102 + d*103 + e*104 + f*105
                        rest = X-price
                        if X >=0:
                            if rest%100 == 0 or rest%101==0 or rest%102==0 or rest%103==0 or rest%104==0 or rest%105==0:
                                print(1)
                                sys.exit()

print(0)

Submission status: Wrong Answer

Solution code:
X=input()
X=int(X)
if (X%100)%2 == 0 or (X%100)%3 == 0 or (X%100)%5 == 0 :
	print("1")
else :
  print("0")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

min_=N//105
max_= N//100 + 1
#print(min_,max_)
for m in range(min_,max_):
    X = N - 100*m
    for i in range(0,X+1):
        for j in range(0,(X-i)//2 +1):
            for k in range(0,(X-i-2*j)//3 +1):
                for l in range(0,(X-i-2*j-3*k)//4 +1):
                    #print(m,i,j,k,l,temp)
                    temp = (X-i-2*j-3*k-4*l)
                    if (temp % 5 == 0) and (m-i-j-k-l-temp//5>=0):
                        a=m-i-j-k-l-temp//5
                        t=temp // 5
                        print(1)
                        print(N,m,a,i,j,k,l,t,100*a+101*i+102*j+103*k+104*l+105*t)
                        sys.exit()
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import sys
from functools import lru_cache
sys.setrecursionlimit(41000000)
n = int(input())
depth = n//100
print(depth)

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: Wrong Answer

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: Wrong Answer

Solution code:
m = int(input())
a = m%100
b = 0
c = 0
d = 0
e = 0
bo = a
co = 5
count = 0
for x in range(5):
  bo = bo % (co - x)
  print(bo)

if a:
  b = a%5
  count += int(a/5)
if b:
  c = a%4
  count += int(b/4)
if c:
  d = a%3
  count += int(c/3)
if d:
  e = a%2
  count += int(d/2)
if e:
  f = a%1
  count += int(e/1)

re = m/100 - count
if re >= 0:
  print("1")
else:
  print("0")

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

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

kosu1 = x//100
kosu2 = x//105

# print(kosu1, kosu2)

# print(x-kosu1*100, x-kosu2*100)
# print(kosu2*5)

if kosu1*5 <= x-kosu1*100 and kosu2*5 <= x-kosu2*100:
    print('0')
else:
    print('1')