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: Time Limit Exceeded

Solution code:
N = list(input()) #e.g. 1432
buf_1 = 0 #入力の3桁目以上 - 2桁目以下 ,1400
buf_2 = 0 #X_1+...+X_6はこれ以下 , 入力の3桁目以上,14
counter = 0 #カウンタ

if len(N) <= 2 : #2桁以下なら終了
    print(0)
    exit()

#3桁以上なら続行
M = 10*int(N[-2]) + int(N[-1]) #入力の2桁目以下,32
for i in range(len(N) - 2) :
    buf_1 += (100*(10**i)) * int(N[-(i+3)]) 
buf_2 = int(buf_1/100) #入力の3桁目以上

##test##
#print('M is')
#print(M)
#print('buf_2 is')
#print(buf_2)
##test##

for j in range(int(M)+1) :
    for k in range(int(M/2)+1) :
        for l in range(int(M/3)+1) :
            for m in range(int(M/4)+1) :
                for n in range(int(M/5)+1) :
                    if M == (1*j+2*k+3*l+4*m+5*n) and (buf_2 -(j+k+l+m+n)) >= 0 :
                        ##test##
                        #print('set is')
                        #print(buf_2 -(j+k+l+m+n),j,k,l,m,n)
                        ##test##
                        print(1)
                        exit()
print(0)

Submission status: Time Limit Exceeded

Solution code:
N = list(input()) #e.g. 1432
buf_1 = 0 #入力の3桁目以上 - 2桁目以下 ,1400
buf_2 = 0 #X_1+...+X_6はこれ以下 , 入力の3桁目以上,14

if len(N) <= 2 : #2桁以下なら終了
    print(0)
    exit()

#3桁以上なら続行
M = 10*int(N[-2]) + int(N[-1]) #入力の2桁目以下,32
for i in range(len(N) - 2) :
    buf_1 += (100*(10**i)) * int(N[-(i+3)]) 
buf_2 = int(buf_1/100) #入力の3桁目以上

Flag_1 = False

for j in range(int(M)+1) :
    for k in range(int(M/2)+1) :
        for l in range(int(M/3)+1) :
            for m in range(int(M/4)+1) :
                for n in range(int(M/5)+1) :
                    if M == (1*j+2*k+3*l+4*m+5*n) and (buf_2 -(j+k+l+m+n)) >= 0 :
                        #print('set is')
                        #print(buf_2 -(j+k+l+m+n),j,k,l,m,n)
                        print(1)
                        Flag_1 = True
                        exit()
if Flag_1 == False :
    print(0)

Submission status: Time Limit Exceeded

Solution code:
import itertools

n = int(input())

max = n // 100

result = 0

for a in itertools.product(range(max+1),range(max+1),range(max+1),range(max+1),range(max+1),range(max+1)):
    if (100 * a[0]) + (101 * a[1]) + (102 * a[2]) + (103 * a[3]) + (104 * a[4]) + (105 * a[5]) == n:
        result = 1
        break
        

print(result)

Submission status: Time Limit Exceeded

Solution code:
x = int(input())

num = set()
for a in range(20):
    for b in range(20):
        for c in range(20):
            for d in range(20):
                for e in range(20):
                    for f in range(20):
                        num.add(
                            100 * a + 101 * b + 102 * c + 103 * d + 104 * e + 105 * f
                        )

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

Submission status: Time Limit Exceeded

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)
if (X >= 2000):
  print(1)
else:
  print(check(X,0))

Submission status: Time Limit Exceeded

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
    for i in range(NA):
        for x in range(0, X+1):
            j = 0
            while x - j * A[i] >= 0:
                if dp[i][x - j * A[i]]:
                    dp[i+1][x] = True
                j += 1
    return 1 if dp[NA][X] else 0
    
if __name__ == '__main__':
    inputs = read()
    output = solve(*inputs)
    print("%d" % output)

Submission status: Time Limit Exceeded

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 > 70000:
    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: Time Limit Exceeded

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**8:
                        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: Time Limit Exceeded

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

def main():
    X = int(input())
    choices = [0,1,2,3,4,5]

    if X < 100:
        print(0)
        return
    
    amount = math.floor(X/100)
    amari = X%100


    for i1 in range(100):
        for i2 in range(50):
            for i3 in range(34):
                for i4 in range(25):
                    for i5 in range(20):
                        if (i1 + i2*2 + i3*3 + i4*4 + i5*5) == amari and i1+i2+i3+i4+i5 <= amount:
                            print(1)
                            return
    
    print(0)
                        

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

for a in range(5001):
    for b in range(5001-100*a):
        for c in range(5001-100*a-101*b):
            for d in range(5001-100*a-101*b-102*c):
                for e in range(5001-100*a-101*b-102*c-103*d):
                    for f in range(5001-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: Time Limit Exceeded

Solution code:
import math
judge = 0
X = int(input())
for a in range(1000000):
    for b in range(1000000):
        for c in range(1000000):
            for d in range(1000000):
                for e in range(1000000):
                    for f in range(1000000):
                        if X == a*100 + b*101 + c*102 + d*103 + e*104 + f*105:
                            judge = 1
                            
print(judge)

Submission status: Time Limit Exceeded

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 rest >= 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: Time Limit Exceeded

Solution code:
x = int( input())

ret = 0
for i5 in range(int(x/105), -1, -1):
    t5 = x - (105 * i5)
    for i4 in range(int(t5/104), -1, -1):
        t4 = t5 - (104 * i4)
        for i3 in range(int(t4/103), -1, -1):
            t3 = t4 - (103 * i3)
            for i2 in range(int(t3/102), -1, -1):
                t2 = t3 - (102 * i2)
                for i1 in range(int(t2/101), -1, -1):
                    z = x - (101 * i1 + 102 * i2 + 103 * i3 + 104 * i4 + 105 * i5)
                    if z >= 0 and z % 100 == 0:
                        ret = 1
                        break

print(ret)

Submission status: Time Limit Exceeded

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 > 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: Time Limit Exceeded

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 > 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=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: Time Limit Exceeded

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()

'''
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: Time Limit Exceeded

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: Time Limit Exceeded

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()
'''
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: Time Limit Exceeded

Solution code:
import sys

x = int(input())

total = 0

for a in range(0,100):
    for b in range(0,100):
        for c in range(0,100):
            for d in range(0,100):
                for e in range(0,100):
                    for f in range(0,100):
                        total = 100*a + 101*b + 102*c + 103*d + 104*e +105*f
                        if x == total:
                            print(1)
                            sys.exit()

print(0)

Submission status: Time Limit Exceeded

Solution code:
x = int( input())

ret = 0
for i5 in range(0, int(x/105)+1):
    t5 = x - (105 * i5)
    for i4 in range(0, int(t5/104)+1):
        t4 = t5 - (104 * i4)
        for i3 in range(0, int(t4/103)+1):
            t3 = t4 - (103 * i3)
            for i2 in range(0, int(t3/102)+1):
                t2 = t3 - (102 * i2)
                for i1 in range(0, int(t2/101)+1):
                    z = x - (101 * i1 + 102 * i2 + 103 * i3 + 104 * i4 + 105 * i5)
                    if z >= 0 and z % 100 == 0:
                        ret = 1
                        break


print(ret)

Submission status: Time Limit Exceeded

Solution code:
x = int(input())

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

def dfs(i, sum):
    if(i == 24):
        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: Time Limit Exceeded

Solution code:
import sys

x = int(input())

total = 0

for a in range(0,1000):
    for b in range(0,1000):
        for c in range(0,1000):
            for d in range(0,1000):
                for e in range(0,1000):
                    for f in range(0,1000):
                        total = 100*a + 101*b + 102*c + 103*d + 104*e +105*f
                        if x == total:
                            print(1)
                            sys.exit()

print(0)

Submission status: Time Limit Exceeded

Solution code:
x = int( input())

ret = 0
for i5 in range(0, int(x/105)+1):
    for i4 in range(0, int(x/104)+1):
        for i3 in range(0, int(x/103)+1):
            for i2 in range(0, int(x/102)+1):
                for i1 in range(0, int(x/101)+1):
                    z = x - (101 * i1 + 102 * i2 + 103 * i3 + 104 * i4 + 105 * i5)
                    if z >= 0 and z % 100 == 0:
                        ret = 1
                        break


print(ret)

Submission status: Time Limit Exceeded

Solution code:
import sys
sys.setrecursionlimit(200000)

x = int(input())
p_L = [i for i in range(100,106)]

max_count = x/100 + 1

def dfs(ans,next,counter):
    global p_L
    global x
    global max_count

    ans += p_L[next]    
    if ans > x:
        return
    if max_count < counter:
        return
    elif ans == x:
        print(1)
        exit()
    
    counter += 1
    for val in range(0,6):
        dfs(ans,val,counter)

counter = 0
for i in range(0,6):
    dfs(0,i,counter)
print(0)

Submission status: Time Limit Exceeded

Solution code:
import sys
sys.setrecursionlimit(200000)

x = int(input())
p_L = [i for i in range(100,106)]


def dfs(ans,next):
    global p_L
    global x
    global stop_memo


    ans += p_L[next]    
    if ans > x:
        return
    elif ans == x:
        print(1)
        exit()
    
    for val in range(0,6):
        dfs(ans,val)


for i in range(0,6):
    dfs(0,i)
print(0)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())


for a in range(N // 100 + 1):
  for b in range(N // 101 + 1):
    for c in range(N // 102 + 1):
      for d in range(N // 103 + 1):
        for e in range(N // 104 + 1):
          for f in range(N // 105 + 1):
            if a * 100 + b * 101 + c * 102 + d * 103 + e * 104 + f * 105 == N:
              print(1)
              exit()
print(0)

Submission status: Time Limit Exceeded

Solution code:
import math
import fractions
from functools import reduce

def loop1(i, k, ans):
  global arr, result
  for ai in range(int(math.floor(k/arr[i])+1)):
    if (i+1<len(arr)):
      loop1(i+1, k-arr[i]*ai, ans+[ai])
    else:
      if arr[i]*ai==k:
        result=ans+[ai]
        break
  return result

def gcd(*arr):
  return reduce(fractions.gcd, arr)

def loop2(i, k, ans):
  global arr, result
  if k%gcd(*arr[i:len(arr)])==0:
    for ai in range(int(math.floor(k/arr[i])+1)):
      if i+1<len(arr):
        loop2(i+1, k-arr[i]*ai, ans+[ai])
      else:
        result=(ans+[ai])
        break
  return result


arr=[100, 101, 102, 103, 104, 105]
k=int(input())
result=""
loop2(0, k, [])
if result=="":
  print(0)
else:
  print(1)

Submission status: Time Limit Exceeded

Solution code:
from itertools import combinations

n= int(input())

l = [100,101,102,103,104,105]
res = [comb for i in range(1,10**5) for comb in combinations(l, i) if sum(comb) == n]

if len(res) >= 1:
  print(1)
else:
  print(0)

Submission status: Time Limit Exceeded

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

def subsets_with_sum(lst, target, subset_lengths=range(1, 100000), method='combinations'):   
    import itertools
    return [comb for i in subset_lengths for comb in
            getattr(itertools, method)(lst, i) if sum(comb) == target]

print(subsets_with_sum(li, X))
  
if len(subsets_with_sum(li, X))>0:
  print(1)
else:
  print(0)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())

for i in range(1000):
  for j in range(1000-i):
    for k in range(1000-i-j):
      for l in range(1000-i-j-k):
        for m in range(1000-i-j-k-l):
          for n in range(1000-i-j-k-l-m):
            price = i*100+j*101+k*102+l*103+m*104+n*105
            if price == n:
              print(1)

print(0)

Submission status: Time Limit Exceeded

Solution code:
import itertools

n = int(input())
pl = [100, 101, 102, 103, 104, 105]
m = int(n / 100)
com = list(itertools.combinations_with_replacement(pl, m))
a = [sum(i) for i in com]
if n in a:
    print('1')
else :
    print('0')

Submission status: Time Limit Exceeded

Solution code:
import itertools
X = int(input())
price=[100,101,102,103,104,105]
num = int(X / 100)
state=False
for i in range(1,num+1):
    for j in itertools.combinations_with_replacement(price, i):
        if sum(j) == X:
            print(1)
            state=True
            exit()
if state != True:
    print(0)

Submission status: Time Limit Exceeded

Solution code:
import math
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**9)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

x = INT()
l = [100,101,102,103,104,105]
flag = [False]

for i in l:
    if x/i==0:
        print(1)
        exit()

def dfs(cur):
    if cur==x:
        flag[0] = True
        return 0
    if cur>x:
        return 1

    if dfs(cur+100)==0:
        return 0
    if dfs(cur+101)==0:
        return 0
    if dfs(cur+102)==0:
        return 0
    if dfs(cur+103)==0:
        return 0
    if dfs(cur+104)==0:
        return 0
    if dfs(cur+105)==0:
        return 0

dfs(0)
if flag[0]:
    print(1)
else:
    print(0)

Submission status: Time Limit Exceeded

Solution code:
x = int( input())

y = x % 100

comb = list()
for i5 in range(0, int(y/5)+1):
    for i4 in range(0, int(y/4)+1):
        for i3 in range(0, int(y/3)+1):
            for i2 in range(0, int(y/2)+1):
                for i1 in range(0, y+1):
                    if y == i1 + 2 * i2 + 3 * i3 + 4 * i4 + 5 * i5:
                        comb.append([i1, i2, i3, i4, i5])

ret = 0
for l in comb:
    m = (x - y) - ((l[0] + l[1] + l[2] + l[3] + l[4]) * 100)
    if m >= 0 and m % 100 == 0:
        ret = 1
        break

print(ret)

Submission status: Time Limit Exceeded

Solution code:
from itertools import product
X = int(input())

tuple_list = []
S = [0, 1, 2, 3, 4, 5]
A = X // 100
B = X - (A * 100)
if A > B:
    print(1)
else:
    for s in product(S, repeat=A):
        if sum(s) == B:
            print(1)
            exit()
    else:
        print(0)

Submission status: Time Limit Exceeded

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

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

print(brute(item_num))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
for a in range(N // 100 + 1):
  for b in range(N // 101 + 1):
    for c in range(N // 102 + 1):
      for d in range(N // 103 + 1):
        for e in range(N // 104 + 1):
          for f in range(N // 105 + 1):
            if a * 100 + b * 101 + c * 102 + d * 103 + e * 104 + f * 105 == N:
              print(1)
              exit()
print(0)

Submission status: Time Limit Exceeded

Solution code:
import itertools
import math
x = int(input())

remain = x % 100
quotient = math.floor(x/100)

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

for moneys in itertools.product(items, repeat=quotient):
    if sum(moneys) == x:
        print(1)
        exit()
print(0)

Submission status: Time Limit Exceeded

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

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

print(brute(item_num))

Submission status: Time Limit Exceeded

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(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: Time Limit Exceeded

Solution code:
import itertools
X=int(input())
ans=0

if (X%100==0)or(X%101==0)or(X%102==0)or(X%103==0)or(X%104==0)or(X%105==0):
    print(str(1))

else:
    for i0,i1,i2,i3,i4,i5 in itertools.product(
        list(range(int(X//100))),
        list(range(int(X//101))),
        list(range(int(X//102))),
        list(range(int(X//103))),
        list(range(int(X//104))),
        list(range(int(X//105)))):
    
        if (i0*100+i1*101+i2*102+i3*103+i4*104+i5*105)==X:
            ans=1
            break
    if ans==1:
        print(str(1))
    else:
        print(str(0))

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
ans = False
for x in range(50, 101):
    if 100 * x > X:
        break
    for y in range(101):
        if 100 * x + 101 * y > X:
            break
        for z in range(101):
            if 100 * x + 101 * y + 102 * z > X:
                break
            for a in range(101):
                if 100 * x + 101 * y + 102 * z + 103 * a > X:
                    break
                for b in range(101):
                    if 100 * x + 101 * y + 102 * z + 103 * a + 104 * b > X:
                        break
                    for c in range(101):
                        if 100 * x + 101 * y + 102 * z + 103 * a + 104 * b + 105 * c == X:
                            print(1)
                            exit()
                        elif 100 * x + 101 * y + 102 * z + 103 * a + 104 * b + 105 * c > X:
                            break
for x in range(50):
    for y in range(101):
        if 100 * x + 101 * y > X:
            break
        for z in range(101):
            if 100 * x + 101 * y + 102 * z > X:
                break
            for a in range(101):
                if 100 * x + 101 * y + 102 * z + 103 * a > X:
                    break
                for b in range(101):
                    if 100 * x + 101 * y + 102 * z + 103 * a + 104 * b > X:
                        break
                    for c in range(101):
                        if 100 * x + 101 * y + 102 * z + 103 * a + 104 * b + 105 * c == X:
                            print(1)
                            exit()
                        elif 100 * x + 101 * y + 102 * z + 103 * a + 104 * b + 105 * c > X:
                            break
print(0)

Submission status: Time Limit Exceeded

Solution code:
import itertools
X=int(input())
ans=0

for i0,i1,i2,i3,i4,i5 in itertools.product(
    list(range(int(X//100)+1)),
    list(range(int(X//101)+1)),
    list(range(int(X//102)+1)),
    list(range(int(X//103)+1)),
    list(range(int(X//104)+1)),
    list(range(int(X//105)+1))):
    
    if (i0*100+i1*101+i2*102+i3*103+i4*104+i5*105)==X:
        ans=1
        break
if ans==1:
    print(str(1))
else:
    print(str(0))

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
Data = [0]*(X+1)
Data[0] = 1

for c in range(100,106):
    for i in range(X+1):
        if Data[i] == 1:
            n = 1
            while c*n + i <= X:
                Data[c*n+i] = 1
                n+=1
if Data[X] == 1:
    print(1)
else:
    print(0)

Submission status: Time Limit Exceeded

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)
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: Time Limit Exceeded

Solution code:
import sys
sys.setrecursionlimit(30000)

def solve(integer_list, target_sum, sum):
  if sum < 0:
    return False
  if sum == 0:
    return True
  for i in integer_list:
    if (solve(integer_list, target_sum, sum - i)):
      return True
  return False

# n個の整数
integer_list = [100,101,102,103,104,105]
# k
target_sum = int(input())

flag = solve(integer_list, target_sum, target_sum)
if flag == True:
  print(1)
else:
  print(0)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
c = 0
for i in range(int(X/105)+1):
    for j in range(int((X-105*i)/104)+1):
        for k in range(int((X-105*i-104*j)/103) +1):
            for l in range(int((X-105*i-104*j-103*k)/102) +1):
                for m in range(int((X-105*i-104*j-103*k-102*l)/101)+1):
                    if (X-105*i-104*j-103*k-102*l-101*m) % 100 == 0:
                        c = 1
                            
print(c)

Submission status: Time Limit Exceeded

Solution code:
x = int(input())

m0 = x // 100
m1 = x // 101
m2 = x // 102
m3 = x // 103
m4 = x // 104
m5 = x // 105

for i in range(m0 + 1):
    for j in range(m1 + 1):
        for k in range(m2 + 1):
            for l in range(m3 + 1):
                for m in range(m4 + 1):
                    for n in range(m5 + 1):
                        if x == 100 * i + 101 * j + 102 * k + 103 * l + 104 * m + 105 * n:
                            print(1)
                            quit()

print(0)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
A = int(input())
a = [100,101,102,103,104,105]

N = A//100
dp = np.array([np.array([0 for i in range(A+1)]) for j in range(N+1)])
dp[0][0] = 1

for i in range(N):
    for j in np.where(dp[i] == 1)[0]:
    #for j in range(A+1):
       # if dp[i][j] == 1:
        dp[i+1][j+100:j+106] = 1

print(dp[N][A])

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
c = 0
for i in range(int(X/100)+1):
    for j in range(int((X-100*i)/101)+1):
        for k in range(int((X-100*i-101*j)/102) +1):
            for l in range(int((X-100*i-102*j-103*k)/103) +1):
                for m in range(int((X-100*i-101*j-102*k-103*l)/104)+1):
                    if (X-100*i-101*j-102*k-103*l-104*m) % 105 == 0:
                        c = 1
                            
print(c)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
ans = False
for x in range(101):
    for y in range(101):
        if 100 * x + 101 * y > X:
            break
        for z in range(101):
            if 100 * x + 101 * y + 102 * z > X:
                break
            for a in range(101):
                if 100 * x + 101 * y + 102 * z + 103 * a > X:
                    break
                for b in range(101):
                    if 100 * x + 101 * y + 102 * z + 103 * a + 104 * b > X:
                        break
                    for c in range(101):
                        if 100 * x + 101 * y + 102 * z + 103 * a + 104 * b + 105 * c == X:
                            print(1)
                            exit()
                        elif 100 * x + 101 * y + 102 * z + 103 * a + 104 * b + 105 * c > X:
                            break
print(0)