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

money = {0}

b = 0

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

while True:
    for i in items:
        if max(money) > x:
            b = 1
            break
        p = money.copy()
        for j in p:
            money.add(j)
            money.add(j+i)
    if b == 1:
        break

if x in money:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())

if x >= 4000:
    print(1)
else:
    found = False
    for i0 in range(x // 100 + 1):
        if found:
            break
        for i1 in range(x // 101 + 1):
            if found:
                break
            for i2 in range(x // 102 + 1):
                if found:
                    break
                for i3 in range(x // 103 + 1):
                    if found:
                        break
                    for i4 in range(x // 104 + 1):
                        if (x - (i0 * 100 + i1 * 101 + i2 * 102 + i3 * 103 + i4 * 104)) % 105 == 0:
                            print(1)
                            found = True
                            break
    if not found:
        print(0)

Submission status: Wrong Answer

Solution code:
X = int(input())
ans = 0
k = [100,101,102,103,104,105,201,202,203,204,205,206,207,208,209,303,304,305,306,307,308,309,310,311,312,406,407,408,409,410,411,412,413,414,510,511,512,513,514,515,615]
for i in range(len(k)):
    if X%k[i]==0:
        print(1)
        ans += 1
        break
if ans ==0:
    print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())

money = {0}

b = 0

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

while True:
    for i in items:
        if max(money) > x:
            b = 1
            break
        p = money.copy()
        for j in p:
            money.add(j)
            money.add(j+i)
    if b == 1:
        break

if x in money:
    print(1)
else:
    print(0)

print(money)

Submission status: Wrong Answer

Solution code:
X = int(input())
if(X<=1 or X>=1000000):
	exit()
else:
	arr = [100, 101, 102, 103, 104, 105, 201, 202, 203, 204, 205, 206, 207, 208, 209, 303, 304, 305, 306, 307, 308, 406, 407, 408, 409, 500, 510, 511, 512, 513, 514, 615]
	if (X in arr):
		print('1')
	else:
		print('0')

Submission status: Wrong Answer

Solution code:
N = int(input())
if N < 100:
    print(0)
    exit()
if N // 100 > int(str(N)[-2:]):
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
x = input()

ans = 0

if len(x) < 3:
    print(ans)

elif len(x) < 4:
    tmp1 = int(x[-2] + x[-1])
    tmp2 = int(x[0])
    if tmp2 * 5 >= tmp1:
        ans = 1

else:
    tmp1 = int(x[-2] + x[-1])
    tmp2 = int(x[-4] + x[-3])
    if tmp2 * 5 >= tmp1:
        ans = 1

print(ans)

Submission status: Wrong Answer

Solution code:
# coding:utf-8
import math
X = int(input())
if X < 100:
  print("0")
  exit()
c = 0
five = 0
four = 0
three = 0
two = 0
one  = 0
x2 = X%100
for i in range(100000):
  x = 0
  if x2/5 > 1 :
    x = math.floor(x2/5)
    x2 -= 5*x
    five = 5*x
  elif x2 / 4 >= 1 :
    x = math.floor(x2/4)
    x2 -= 4*x
    four = 4*x
  elif x2 / 3 >= 1 :
    x = math.floor(x2/3)
    x2 -= 3*x
    three = 3*x
  elif x2 / 2 >= 1 :
    x = math.floor(x2/2)
    x2 -= 2*x
    two = 2*x
  elif x2 / 1 == 1 :
    x = math.floor(x2/1)
    x2 -= 1*x
    one = 1*x
  c += x
  if x2 == 0:
    break
if c == 0 or X == c*100+five+four+three+two+one:
  print("1")
else :
  print("0")

Submission status: Wrong Answer

Solution code:
l=[105,101,102,103,104]
x=int(input())
check=0
if x==0:
  check=1
while x>=100:
    a=x%100
    v=x%5
    if a==0:
        check=1
        break
    else:
        x-=l[v]
if check==1:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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 ans < tmp:break
print('0')

Submission status: Wrong Answer

Solution code:
line = input()

if int(line) >= 100:
    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)

else:
    print(0)

Submission status: Wrong Answer

Solution code:
import itertools

x = int(input())

if x < 100:
    print("0")
n = x // 100
r = x % 100

nums = [0, 1, 2, 3, 4, 5]
for balls in itertools.product(nums, repeat=n):
    if sum(balls) == r:
        print('1')
        break
else:
    print('0')

Submission status: Wrong Answer

Solution code:
x = int(input())

if x >= 4000:
    print(1)
else:
    found = False
    for i0 in range(x // 100):
        if found:
            break
        for i1 in range(x // 100):
            if found:
                break
            for i2 in range(x // 100):
                if found:
                    break
                for i3 in range(x // 100):
                    if found:
                        break
                    for i4 in range(x // 100):
                        if (x - (i0 * 100 + i1 * 101 + i2 * 102 + i3 * 103 + i4 * 104)) % 105 == 0:
                            print(1)
                            found = True
                            break
    if not found:
        print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
amari = x%100
tiket = x//100
ans = 0
i = 0
while (tiket > 0 and i < 6):
  if amari == 0:
    ans = 1
    break
  else:
    tiket -= amari//(5-i)
    amari = amari % (5-i)
    i += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(raw_input())

f = n / 100
m = n % 100

x = -1
done = False
ans = -1
for k in xrange(f):
    for i in xrange(1,6):
        if (m - k) % i == 0:
            x = (m - k)/ i
            # print x
            if x <= f:
                ans = 1
                done = True
                break

print ans

Submission status: Wrong Answer

Solution code:
x=int(input())

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

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

Submission status: Wrong Answer

Solution code:
import sys
x = input()

l = len(x)
if l == 6:
    print(1)
    sys.exit(0)
elif l <= 2:
    print(0)
    sys.exit(0)
elif l == 3:
    top = int(x[0:1])
    left = int(x[1:])
    if top * 5 < left:
        print(0)
    else:
        print(1)
    sys.exit(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
x = int(input())
l = x // 100
if x >= 2000 and l % 20 == 0:
    k = 20
else:
    k = l % 20
min = l*100
max = l*100 + k*5
if min <= x <= max:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
# coding:utf-8
import math
X = int(input())
if X <= 100:
  print("0")
  exit()
c = 0
x2 = X%100
for i in range(100000):
  x = 0
  if x2/5 > 1 :
    x = math.floor(x2/5)
    x2 -= 5*x
    five = 5*x
  elif x2 / 4 >= 1 :
    x = math.floor(x2/4)
    x2 -= 4*x
    four = 4*x
  elif x2 / 3 >= 1 :
    x = math.floor(x2/3)
    x2 -= 3*x
    three = 3*x
  elif x2 / 2 >= 1 :
    x = math.floor(x2/2)
    x2 -= 2*x
    two = 2*x
  elif x2 / 1 == 1 :
    x = math.floor(x2/1)
    x2 -= 1*x
    one = 1*x
  c += x
  if x2 == 0:
    break
if c == 0 or X >= c*100:
  print("1")
else :
  print("0")

Submission status: Wrong Answer

Solution code:
import math
X=int(input())
R=X%100
Q=X//100
if math.floor(R/5)<=Q:
  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] * 6 for i in range(1000)]
for i in range(1000):
    for j in range(6):
        if i == 0:
            sum_list[i][j] = sum_list[i][j - 1] + pre_list[i][j]
        elif j == 0:
            sum_list[i][j] = sum_list[i - 1][j] + pre_list[i][j]
        else:
            sum_list[i][j] = sum_list[i - 1][j] + sum_list[i][j - 1] - sum_list[i - 1][j - 1] + pre_list[i][j]

flag = 0
for i1 in range(0, 999):
    for i2 in range(i1+1, 1000):
        for j1 in range(0, 5):
            for j2 in range(j1+1, 6):
                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: Wrong Answer

Solution code:
import itertools

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

Submission status: Wrong Answer

Solution code:
a = int(input())
b = str(a)
if len(b) == 1 or len(b) == 2:
    print(0)
elif len(b) == 3:
    if b[0] == 1:
        if b[-1] == 0 or b[-1] == 1 or  b[-1] == 2 or b[-1] == 3 or b[-1] == 4 or b[-1] == 5:
            print(1)
        else:
            print(0)
    else:
        print(1)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
X = int(input())
n = 6

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




ans = 0
for i in range(2**6):
    
    s = 0
    for j in range(6):
        if (1 & i >> j) == 1:
            s += l[j]
    if s != 0:
         if  X % s == 0:
            ans = 1
   

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
x=(input())
if int(x) < 100:
    print(0)
else:
    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: Wrong Answer

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 ans < tmp:break
print('0')

Submission status: Wrong Answer

Solution code:
x = int(input())
if x < 100:
	print(1)
	exit()

l = len(str(x))
y = str(x)
head = int(y[0])
tail = x - 100*head

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

Submission status: Wrong Answer

Solution code:
import sys
# x = input()
x = "615"

l = len(x)
if l == 6:
    print(1)
    sys.exit(0)
elif l <= 2:
    print(0)
    sys.exit(0)
elif l == 3:
    top = int(x[0:1])
    left = int(x[1:])
    if top * 5 < left:
        print(0)
    else:
        print(1)
    sys.exit(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
for i in range(1, 50):
  n = x // 105 + 1
  if x % 105 >= 5*n:
    print('1')
    exit()
print('0')

Submission status: Wrong Answer

Solution code:
import sys
from decimal import Decimal, ROUND_HALF_UP
import math
input = sys.stdin.readline
#sys.setrecursionlimit(1e9)

def main():
    """code here"""
    x=int(input())
    ans = 0
    if (x/100)<1:
        print("0")
        exit()
    num = math.floor(x/100)

    x = x %1000
    for i in range(11):
        for j in range(10):
            for k in range(10):
                for l in range(10):
                    for p in range(10):
                        ans=x - 100*i-101*j-102*k-103*l-104*p
                        if ans>=0 and ((ans)%105==0):
                            print("1")
                            exit()


    print("0")



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x=input()
x=int(x)
def part_sum0(a,A):
  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: 
        dp[i+1][j]=dp[i][j-a[i]] or dp[i][j]
      else: 
        dp[i+1][j]=dp[i][j]
  return dp[N][A]
a=[100,101,102,103,104,105]

print(part_sum0(a,x))

Submission status: Wrong Answer

Solution code:
from itertools import permutations, combinations,combinations_with_replacement,product

X =int(input())

s =str(X/100)

s_list =s.split('.')

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

for h in range(1,int(s_list[0])+1):
    for i in combinations_with_replacement(A,h):
        if sum(i) == int(s_list[1]):
            print(i)
            #print("1")
            #exit()

print("0")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys

X = str(input())
n = len(X)

if n <= 2:
    print("0")
    sys.exit()

keta = int(X[n-2]+X[n-1])

tmp = 0
for i in [5,4,3,2,1]:
    sho = keta/i
    amari = int(keta%i)
    tmp += int(sho)
    if amari == 0:
        break
    keta = amari

wa = ""
for i in reversed(range(n-2)):
    wa += X[i]
if tmp > int(wa):
    print("0")
else:
    print("1")

Submission status: Wrong Answer

Solution code:
x = int(input())

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

elif 2000 <= x:
    print(1)
    exit(0)
'''
if 10000 < x:
    t = str(x)
    x = int(t[-4:])
'''

n = int(x/100)

if n*100 <= x < n*100+n*5:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
x=int(input())
a=x//100
b=x%100
ans=0
if b//5 < a:
    for i in range(a+1):
        if (b-5*i)//4 < (a-i):
            for j in range(a+1-i):
                if (b-5*i-4*j)//3 < (a-i-j):
                    for k in range(a+1-i-j):
                        if (b-5*i-4*j-3*k)//3 < (a-i-j-k):
                            for l in range(a+1-i-j-k):
                                if (b-5*i-4*j-3*k-2*l)//3 < (a-i-j-k-l):
                                    for m in range(a+1-i-j-k-l):
                                        if 5*i+4*j+3*k+2*l+m==b:
                                            ans=1
                                            break
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

def a(lst, target, with_replacement=False):
    def _a(idx, l, r, t, w):
        if t == sum(l):
            r.append(l)
            exit()
        elif t < sum(l): return
        for u in range(idx, len(lst)):
            _a(u if w else (u + 1), l + [lst[u]], r, t, w)
        return r
    return _a(0, [], [], target, with_replacement)

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

res = a( goods, x, True)
print(1) if len(res)>0 else print(0)

Submission status: Wrong Answer

Solution code:
import itertools

x = int(input())

if x < 100:
    print("0")
n = x // 100
r = x % 100

nums = [0, 1, 2, 3, 4, 5]
for balls in itertools.combinations_with_replacement(nums, n):
    if sum(balls) == r:
        print('1')
        break
else:
    print('0')

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
a = x%100
ans = 0
MAX = 1000000

if x < 100:
    ans = 0
elif math.ceil(a//5) <= x//100 <= MAX:
    ans = 1
    
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from pprint import pprint
import sys


def solve(n):
    under = int(str(n)[-2:])
    for i in range(under // 5, 0, -1):
        for j in range(under // 4, 0, -1):
            for k in range(under // 3, 0, -1):
                for l in range(under // 2, 0, -1):
                    for m in range(under, 0, -1):
                        if i * 5 + j * 4 + k * 3 + l * 2 + m == under:
                            sum_n = i+j+k+l+m
                            # print(i+j+k+l+m)
                            if 100 * sum_n <= n - under:
                                print(1)
                                return
    print(0)
    

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

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

a_count = math.floor((1000000/100)/x)
b_count = math.floor((1000000/101)/x)
c_count = math.floor((1000000/102)/x)
d_count = math.floor((1000000/103)/x)
e_count = math.floor((1000000/104)/x)
f_count = math.floor((1000000/105)/x)

count = 0

for a in range(a_count):
  for b in range(b_count):
    for c in range(c_count):
      for d in range(d_count):
        for e in range(e_count):
          for f in range(f_count):
            calc = (a * 100) + (b * 101) + (c * 102) + (d * 103) + (e * 104) + (f * 105)
            if calc == x:
              count = 1
              break
          if count == 1:
            break
        if count == 1:
          break
      if count == 1:
        break
    if count == 1:
      break
  if count == 1:
    break
print(count)

Submission status: Wrong Answer

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

def brute(t):
    for i in range(t+1):
        for j in range(0,t+1-i):
            for k in range(0,t+1-i-j):
                for l in range(0,t+1-i-j-k):
                    for m in range(0,t+1-i-j-k-l):
                        for n in range(0,t+1-i-j-k-l-m):
                            if (100 * i + 101 * j + 102 * k +  103 * l + 104 * m + 105 * n ) == n:
                              return 1
    return 0

print(brute(item_num))

Submission status: Wrong Answer

Solution code:
X = int(input())

XX = X%100
A = []
for i in range(20):
  for j in range(25):
    for k in range(100):
      for l in range(50):
        if i*5+j*4+k*3+l*2 <= XX:
          A.append((XX-i*5+j*4+k*3+l*2,l,k,j,i))
#print(A)
for a,b,c,d,e in A:
  if a*101+b*102+c*103+d*104+e*105 <= X:
    print(1)
    exit()
print(0)

Submission status: Wrong Answer

Solution code:
import sys
from decimal import Decimal, ROUND_HALF_UP
import math
input = sys.stdin.readline
#sys.setrecursionlimit(1e9)

def main():
    """code here"""
    x=int(input())
    ans = 0
    if (x/100)<1:
        print("0")
        exit()
    num = math.floor(x/100)

    x = x %1000
    for i in range(10):
        for j in range(10):
            for k in range(10):
                for l in range(10):
                    for p in range(10):
                        ans=x - 100*i-101*j-102*k-103*l-104*p
                        if ans>=0 and ((ans)%105==0):
                            print("1")
                            exit()


    print("0")



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = input()
x2 = int(x[-2:])
x = int(x)
c = 0
for i in [5,4,3,2,1]:
    a, b = divmod(x2, 5)
    c = c+a
    x2 = b
if x2 == 0:
    print(1 if 100*c < x else 0)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
if x < 100:
	print(0)
	exit()

l = len(str(x))
y = str(x)
head = int(y[0])
tail = x - 100*head
"""
if tail > 5*head:
	print(0)
else :
	print(1)
"""
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
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

x = int(input())

n = x // 105 + 1
if x % 105 >= 5*n:
  print('1')
else:
  print('0')

Submission status: Wrong Answer

Solution code:
X = int(input())

max_a = 10 ** 5 // 100
max_n = max_a // 100


def sum_X(n_list):
    x = sum([n * (100 + i) for i, n in enumerate(n_list)])
    return x


for a in range(max_a):
    if a > max_n:
        break
    for b in range(max_a):
        n = sum([a, b])
        if n > max_n:
            break
        for c in range(max_a):
            n = sum([a, b, c])
            if n > max_n:
                break
            for d in range(max_a):
                n = sum([a, b, c, d])
                if n > max_n:
                    break
                for e in range(max_a):
                    n = sum([a, b, c, d, e])
                    if n > max_n:
                        break
                    for f in range(max_a):
                        n = sum([a, b, c, d, e, f])
                        if n > max_n:
                            break
                        if X == sum_X([a, b, c, d, e, f]):
                            print(1)
                            exit()
print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
if x < 100:
	print(0)
	exit()

l = len(str(x))
y = str(x)
head = int(y[0])
tail = x - 100*head
"""
if tail > 5*head:
	print(0)
else :
	print(1)
"""
print(0)

Submission status: Wrong Answer

Solution code:
import itertools

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

Submission status: Wrong Answer

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

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

Solution code:
X = int(input())
#lower
abcde = X // 102
db = X % 2
if (X - 102 * abcde - db) // 2 <= abcde - db:
    print(1)
    exit()
#greater
abcde = X // 102 + 1
db = X % 2
if (102 * abcde - db) // 2 <= abcde - db:
    print(1)
    exit()
print(0)

Submission status: Wrong Answer

Solution code:

X = int(input())

flag = True
cnt=0

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

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

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

if flag:
    N = X//1000
    V = X-N*1000

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

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

if flag:
    N = X//10000
    V = X-N*10000

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

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

if flag:
    print(0)

Submission status: Wrong Answer

Solution code:
from itertools import permutations, combinations,combinations_with_replacement,product

X =int(input())

s =str(X/100)

s_list =s.split('.')

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

for h in range(int(s_list[0])):
    for i in combinations_with_replacement(A,h):
        if sum(i) == int(s_list[1]):
            print("1")
            exit()

print("0")

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%615==0:
  print(1)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
import sys
from decimal import Decimal, ROUND_HALF_UP
import math
input = sys.stdin.readline
#sys.setrecursionlimit(1e9)

def main():
    """code here"""
    x=int(input())
    ans = 0
    if (x/100)<1:
        print("0")
        exit()
    num = math.floor(x/100)

    x = x %1000
    for i in range(10):
        for j in range(10):
            for k in range(10):
                for l in range(10):
                    for p in range(10):
                        ans=x - 100*i-101*j-102*k-103*l-104*p
                        if ans>=0 and(ans) %105==0:
                            print("1")
                            exit()


    print("0")



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
amari = x%100
tiket = x//100
ans = 0
i = 0
while (tiket > 0 and i < 5):
  if amari == 0:
    ans = 1
    break
  else:
    tiket -= amari//(5-i)
    amari = amari % (5-i)
    i += 1
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

def a(lst, target, with_replacement=False):
    def _a(idx, l, r, t, w):
        if t == sum(l):
            r.append(l)
        elif t < sum(l): return
        for u in range(idx, len(lst)):
            _a(u if w else (u + 1), l + [lst[u]], r, t, w)
        return r
    return _a(0, [], [], target, with_replacement)

goods = [1, 2, 3, 4, 5]

cnt = int(x/100)
flg = 0
while flg != 1:
    res = a(goods, x-cnt*100, True)
    for comb in res:
        if len(comb) <= cnt:
            flg = 1
            break
    cnt -= 1

Submission status: Wrong Answer

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

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

s = str(N)
h = int("".join(s[:-2]))
t = int("".join(s[-2:]))

for i in range(101):
    total = i
    if t<total:
        continue
    for j in range(51):
        if not j==0:
            total+=2
        if t<total:
            continue
        for k in range(34):
            if not k==0:
                total+=3
            if t<total:
                continue
            for l in range(26):
                if not l==0:
                    total+=4
                if t<total:
                    continue
                for m in range(21):
                    if not m==0:
                        total+=5
                    if t<total:
                        continue
                    if t==total and (i+j+k+l+m)<=h:
                        print(1)
                        exit(0)
print(0)

Submission status: Wrong Answer

Solution code:
X=int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())

money = {0}

b = 0

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

while True:
    for i in items:
        if b == 1:
            break
        p = money.copy()
        for j in p:
            money.add(j)
            money.add(j+i)
            if max(money) > x+106:
                b = 1
                break
    if b == 1:
        break

if x in money:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

def brute(t):
    for i in range(t):
        for j in range(t):
            for k in range(t):
                for l in range(t):
                    for m in range(t):
                        for n in range(t):
                            if (100 * i + 101 * j + 102 * k +  103 * l + 104 * m + 105 * n ) == n:
                              return 1
    return 0

print(brute(item_num))

Submission status: Wrong Answer

Solution code:
x = int(input())
n = x//100 + 1

for i in range(n):
  for j in range(n):
     for k in range(n):
         for l in range(n):
             for m in range(n):
                 
               c = 100*i + 101*j + 102*k + 103*l + 104*m
               t = x-c
                
               if t%105 == 0:
               	print(1)
                exit()
                    
print(0)

Submission status: Wrong Answer

Solution code:
n=int(input())

item=n//100
money = n-item*100
while money<item:
  item -=1
  money = n-item*100

if item*5 < money:
  print(0)
else:
  print(1)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n>=615:
  print(1)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N in [100,101,102,103,104,105]:
    print(1)
else:
    x = N%100
    xx = N//100
    y = x%5
    yy = x//5
    print(y,yy)
    if y == 0 and xx-yy >= 0:
        print(1)
    elif  xx-yy>1:
        print(1)
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
import sys
import sys
from decimal import Decimal, ROUND_HALF_UP
import math
input = sys.stdin.readline
#sys.setrecursionlimit(1e9)

def main():
    """code here"""
    x=int(input())
    ans = 0
    if (x/100)<1:
        print("0")
        exit()
    num = math.floor(x/100)

    x = x %1000
    for i in range(10):
        for j in range(10):
            for k in range(10):
                for l in range(10):
                    for p in range(10):
                        ans=x - 100*i-101*j-102*k-103*l-104*p
                        if ans>0 and(ans) %105==0:
                            print("1")
                            exit()


    print("0")



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
X = int(input())
n = 6

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

for i in range(6):
    if X % l[i] == 0:
        print(1)
        break


ans = 0
for i in range(2**6):
    
    s = 0
    for j in range(6):
        if (1 & i >> j) == 1:
            s += l[j]

    if s == X:
        ans = 1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr=[100,101,102,103,104,105,201,202,203,204,205,206,207,208,209,303,312,406,414,510,515,615]
if n in arr:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

Solution code:
x = int(input())
a = 0
i = 0
while a <= x:
  a += 100
  i += 1
a -= 100
i -= 1
y = x - 100*a
if y <= i*5:
  print("1")
else:
  print("0")