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:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)

def f(x):
    memo = {}
    if x == 0:
        return True
    elif x < 0:
        return False
    elif x in memo.keys():
        return f(memo[x])
    for i in range(6):
        if f(x-100-i):
            memo[x] = True
            return True
    return False

def main():
    X = int(input())
    print(int(f(X)))

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)

def f(x):
    memo = {}
    if x == 0:
        return True
    elif x < 0:
        return False
    elif x in memo.keys():
        return f(memo[x])
    for i in range(6):
        if f(x-100-i):
            memo[x] = True
            return True
    return False

def main():
    X = int(input())
    print(int(f(X)))

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)

def f(x):
    if x == 0:
        return True
    elif x < 0:
        return False
    for i in range(6):
        if f(x-100-i):
            return True
    return False

def main():
    X = int(input())
    print(int(f(X)))

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

p=[100,101,102,103,104,105]
x=int(input())

def dfs(sum):
    ans=False
    if sum>=x:
        return sum==x
    for i in p:
        ans|=dfs(sum+i)
    return ans 

if x>=2000:
    print(1)
elif dfs(0):
    print(1)
else:
    print(0)

Submission status: Time Limit Exceeded

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

p=[100,101,102,103,104,105]
x=int(input())

def dfs(sum):
    ans=False
    if sum>=x:
        return sum==x
    for i in p:
        ans|=dfs(sum+i)
    return ans 

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

Submission status: Time Limit Exceeded

Solution code:
import itertools
X = int(input())
num = X//100
r = X % 100
li = [0, 1, 2, 3, 4, 5]
flag = False
for i in itertools.product(li, repeat=num):
    if sum(i) == r:
        flag = True
        break
print('1' if flag else '0')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
if X < 100:
    print(0)
else:
    item = [100, 101, 102, 103, 104, 105]
    dp = [[False for _ in range(X//100+10)] for _ in range(X+10)]
    dp[0][0] = True
    dp[100][1] = True
    dp[101][1] = True
    dp[103][1] = True
    dp[102][1] = True
    dp[105][1] = True
    for x in range(200, X+1):
        for n in range(2, x//100+1):
            for i in item:
                if dp[x-i][n-1]:
                    dp[x][n] = True
                    if x == X:
                        break
    if True in dp[X]:
        print(1)
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
if X < 100:
    print(0)
else:
    item = [100, 101, 102, 103, 104, 105]
    dp = [[False for _ in range(X//100+10)] for _ in range(X+10)]
    dp[0][0] = True
    dp[100][1] = True
    dp[101][1] = True
    dp[102][1] = True
    dp[105][1] = True
    for x in range(100, X+1):
        for n in range(1, X//100+4):
            for i in item:
                if dp[x-i][n-1]:
                    dp[x][n] = True
    if True in dp[x]:
        print(1)
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
import itertools
x = int(input())
l = [0,1,2,3,4,5]
k = x%100
n = x//100
ans = '0'
if n*5>=k:
    c = list(itertools.combinations_with_replacement(l,n))
    for i in c:
        if sum(i)==k:
            ans = '1'
            break
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import itertools
x = int(input())
l = [0,1,2,3,4,5]
k = x%100
n = x//100
ans = '0'
c = list(itertools.product(l,repeat = n))
for i in c:
    if sum(i)==k:
        ans = '1'
        break
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import itertools
x = int(input())
l = [0,1,2,3,4,5]
k = x%100
n = x//100
ans = '0'
c = list(itertools.combinations_with_replacement(l,n))
for i in c:
    if sum(i)==k:
        ans = '1'
        break
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import itertools
x = int(input())
if x>=2000:
  print(1)
  exit()
else:
  l = list(range(20))
  for nums in itertools.product(l,repeat=6):
    if nums[0]*100+nums[1]*101+nums[2]*102+nums[3]*103+nums[4]*104+nums[5]*105==x:
      print(1)
      exit()
print(0)

Submission status: Time Limit Exceeded

Solution code:
import itertools
x = int(input())
if x>=2000:
  print(1)
  exit()
else:
  l = list(range(20))
  for nums in itertools.product(l,repeat=6):
    t = nums[0]*100+nums[1]*101+nums[2]*102+nums[3]*103+nums[4]*104+nums[5]*105
    if t==x:
      print(1)
      exit()
print(0)

Submission status: Time Limit Exceeded

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
MENU = [100,101,102,103,104,105]
ok = False

X = int(input())
def readInts():
  return list(map(int,input().split()))
def dfs(Price):
    global X
    global ok
    if Price >= X:
        if Price == X:
            ok = True
            return
        else:
            return
    if not ok:
        for v in MENU:
            Price += v
            if Price > X:
                Price -= v
                continue
            dfs(Price)
            Price -= v
def main():
    dfs(0)
    print(1 if ok else 0)
if __name__ == '__main__':
  main()

Submission status: Time Limit Exceeded

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
MENU = [100,101,102,103,104,105]
ok = False

X = int(input())
def readInts():
  return list(map(int,input().split()))
def dfs(Price):
    global X
    global ok
    if Price >= X:
        if Price == X:
            ok = True
            return
        else:
            return
    if not ok:
        for v in MENU:
            Price += v
            dfs(Price)
            Price -= v
def main():
    dfs(0)
    print(1 if ok else 0)
if __name__ == '__main__':
  main()

Submission status: Time Limit Exceeded

Solution code:
x=int(input())

ans=0
for i in range(x//105+1):
    for j in range(x//104+1):
        for k in range(x//103+1):
            for l in range(x//102+1):
                for m in range(x//101+1):
                    for n in range(x//100+1):
                        if i*105+j*104+k*103+l*102+m*101+n*100==x:
                            ans=1
                            break

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
from math import  *
import copy

input = int(input())

def getMoney(money):
    prices = [100, 101, 102, 103, 104, 105]
    rem = []
    for element in prices:
        rem.append(money - money * floor(money/element))
    bounds = [floor(money/element) + 1 for element in prices]
    for index1 in range(bounds[0]):
        for index2 in range(bounds[1]):
            for index3 in range(bounds[2]):
                for index4 in range(bounds[3]):
                    for index5 in range(bounds[4]):
                        for index6 in range(bounds[5]):
                            if (index1 * prices[0] + index2 * prices[1] +index3 * prices[2] + index4 * prices[3] + index5 * prices[4] + index6 * prices[5] == money):
                                return 1
    return 0

print(getMoney(input))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
 
ans = 0
for i in range(1, n+1):
  if n in list(range(100 * i, 105 * i + 1)):
    ans = 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
 
ans = 0
for i in range(1, n+1):
  for x in range(100 * i, 105 * i + 1):
    if n == x:
      ans = 1
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
x = int(input())


y = x // 100
z = x % 100
t = 0
for i in range(101):
    if t == 1 or i>y:
        break
    for j in range(101):
        if t == 1 or i+j > y:
            break
        for k in range(101):
            if t == 1 or i+j+k > y:
                break
            for l in range(101):
                if t == 1 or i+j+k+l > y:
                    break
                for m in range(101):
                    if t == 1 or i+j+k+l+m > y:
                        break
                    for n in range(101):
                        if t == 1 or i+j+k+l+m+n > y:
                            break
                        if (i+j+k+l+m+n == y):
                            if i*0+j*1+k*2+l*3+m*4+n*5 == z:
                                t = 1
                                break
                        if (i+j+k+l+m+n > y):
                            break
if t == 1:
    print(1)
else:
    print(0)

Submission status: Time Limit Exceeded

Solution code:
def main():
    X = int(input())
    if 2000 <= X:
        return print(1)
    if X < 100:
        return print(0)
    from itertools import product
    for c in product(range(20), repeat=6):
        if c[0]*100 + c[1]*101 + c[2]*102 + c[3]*103 + c[4]*104 + c[5]*105 \
                == X:
            return print(1)
    else:
        return print(0)


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
# C - 100 to 105
from collections import defaultdict


def main():
    X = int(input())
    items = tuple(range(100, 106))
    dp = defaultdict(bool)
    dp[0] = True
    while max(dp.keys()) < X:
        for possible_price in tuple(dp.keys()):
            for item in items:
                dp[possible_price + item] = True
    print(int(X in dp))


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import itertools

x = int(input())

x_100 = x // 100

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

a = list(itertools.combinations_with_replacement(l,x_100))

ans = []
for i in a:
    ans.append(sum(i))

if ans.count(x) > 0:
    print(1)
else:
    print(0)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
count = 0
for a in range(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):
                        if 100*a + 101*b + 102*c + 103*d + 104*e + 105*f == X:
                            print(1)
                            break
if count == 0:
    print(0)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())  # sum
MAX_NUM = 20

ans = 0

if X >= 2000:
    ans = 1

quo_A = int(X / 5)
for cnt_A in range(0, min(quo_A, MAX_NUM) + 1):
    # print("cnt_A: " + str(cnt_A))

    quo_B = int((X - cnt_A * 105) / 104)
    for cnt_B in range(0, min(quo_B, MAX_NUM) + 1):
        # print("cnt_B: " + str(cnt_B))

        quo_C = int((X - cnt_A * 105 - cnt_B * 104) / 103)
        for cnt_C in range(0, min(quo_C, MAX_NUM) + 1):
            # print("cnt_C: " + str(cnt_C))

            quo_D = int((X - cnt_A * 105 - cnt_B * 104 - cnt_C * 103) / 102)
            for cnt_D in range(0, min(quo_D, MAX_NUM) + 1):
                # print("cnt_C: " + str(cnt_C))

                quo_E = int((X - cnt_A * 105 - cnt_B * 104 - cnt_C * 103 - cnt_D * 102) / 101)
                for cnt_E in range(0, min(quo_E, MAX_NUM) + 1):

                    quo_F = int((X - cnt_A * 105 - cnt_B * 104 - cnt_C * 103 - cnt_D * 102 - cnt_E * 101) / 100)
                    for cnt_F in range(0, min(quo_F, MAX_NUM) + 1):
                        if cnt_A * 105 + cnt_B * 104 + cnt_C * 103 + cnt_D * 102 + cnt_E * 101 + cnt_F * 100 == X:
                            # print([cnt_A, cnt_B, cnt_C, cnt_D, cnt_E, cnt_F])
                            ans = 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())

num = X // 100

res = 0

for a in range(num+1):
    for b in range(num-a+1):
        for c in range(num-(a+b)+1):
            for d in range(num-(a+b+c)+1):
                for e in range(num-(a+b+c+d)+1):
                    for f in range(num-(a+b+c+d+e)+1):
                        if a*100 + b*101 + c*102 + d*103 + e*104 + f*105 == X:
                            res = 1
                            break

print(res)

Submission status: Time Limit Exceeded

Solution code:
import itertools
X=int(input())
l=[100,101,102,103,104,105]
for i in range(1,X//100+1):
  for v in itertools.combinations_with_replacement(l,i):
    if sum(v)==X:
      print(1)
      exit()
print(0)

Submission status: Time Limit Exceeded

Solution code:
x = int(input())

if x >= 2000:
    print(1)
else:
    flag = False
    n = 19
    for a in range(n):
        for b in range(n):
            for c in range(n):
                for d in range(n):
                    for e in range(n):
                        for f in range(n):
                            if x == a * 100 + b * 101 + c * 102 + d * 103 + e * 104 + f * 105:
                                flag = True
                                break
                        if flag:
                            break
                    if flag:
                        break
                if flag:
                    break
            if flag:
                break
        if flag:
            break

    print(1) if flag else print(0)

Submission status: Time Limit Exceeded

Solution code:
x = int(input())

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

    print(1) if flag else print(0)

Submission status: Time Limit Exceeded

Solution code:
X = input().split()

for a in range(1001):
    for b in range(1001):
        for c in range(1001):
            for d in range(1001):
                for e in range(1001):
                    for f in range(1001):
                        y =100*a +101*b + 102*c +103*d + 104*e + 105*f
                        if y == X:
                            print(1)
                        else:
                            print(0)

Submission status: Time Limit Exceeded

Solution code:
X = input().split()

for a in range(10001):
    for b in range(10001):
        for c in range(10001):
            for d in range(10001):
                for e in range(10001):
                    for f in range(10001):
                        y =100*a +101*b + 102*c +103*d + 104*e + 105*f
                        if y == X:
                            print(1)
                        else:
                            print(0)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
mod = X % 100
q = int(X //100)
sum = 0
ans = 0
for i in range (0,q+1):
    for j in range (0,q+1-i):
        for k in range (0,q+1-i-j):
            for l in range (0,q+1-i-k-j):
                for m in range (0,q+1-i-j-k-l):
                    sum = i+(2*j)+(3*k)+(4*l)+(5*m)
                    if sum == mod:
                        ans = 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import queue
x=int(input())
avail=list(range(100,106))
q=queue.Queue()
for i in avail:
    q.put(i)
while not q.empty():
    f=q.get()
    for i in range(100,106):
        if(i+f<=x and i+f not in avail):
            avail.append(i+f)
            q.put(i+f)
print(1 if x in avail else 0)

Submission status: Time Limit Exceeded

Solution code:
import queue
x=int(input())
avail=list(range(100,106))+[0]*x
q=queue.Queue()
for i in avail:
    q.put(i)
while not q.empty():
    f=q.get()
    for i in range(100,106):
        if(i+f<=x and i+f not in avail):
            avail.append(i+f)
            q.put(i+f)
print(1 if x in avail else 0)

Submission status: Time Limit Exceeded

Solution code:
import queue
x=int(input())
avail=list(range(100,106))
q=queue.Queue()
ok=[False]*max(x+1,106)
for i in avail:
    q.put(i)
    ok[i]=True
while not q.empty():
    f=q.get()
    for i in avail:
        if(i+f<=x and not ok[i+f]):
            avail.append(i+f)
            q.put(i+f)
            ok[i+f]=True
print(1 if x in avail else 0)

Submission status: Time Limit Exceeded

Solution code:
import queue
x=int(input())
q=queue.Queue()
avail=list(range(100,106))
for i in avail:
    q.put(i)
while not q.empty():
    f=q.get()
    for i in avail:
        if(i+f<=x and i+f not in avail):
            avail.append(i+f)
            q.put(i+f)
print(1 if x in avail else 0)

Submission status: Time Limit Exceeded

Solution code:
X = input().split()

for a in range(1000001):
    for b in range(1000001):
        for c in range(1000001):
            for d in range(1000001):
                for e in range(1000001):
                    for f in range(1000001):
                        y =100*a +101*b + 102*c +103*d + 104*e + 105*f
                        if y == X:
                            print(1)
                        else:
                            print(0)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())


def cal(x, c1, c2, c3, c4, c5):
    if x == 0 or x % 100 == 0:
        print(1)
        exit()

    else:
        now = x - 100
        if now >= 0:
            if c1 < 19:
                cal(now-1, c1+1, c2, c3, c4, c5)
            if c2 < 19:
                cal(now-2, c1, c2+1, c3, c4, c5)
            if c3 < 19:
                cal(now-3, c1, c2, c3+1, c4, c5)
            if c4 < 19:
                cal(now-4, c1, c2, c3, c4+1, c5)
            if c5 < 19:
                cal(now-5, c1, c2, c3, c4, c5+1)

    return 0


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

Submission status: Time Limit Exceeded

Solution code:
X = int(input())


def cal(x, c1, c2, c3, c4, c5):
    if x == 0 or x % 100 == 0:
        print(1)
        exit()

    else:
        now = x - 100
        if now >= 0:
            cal(now-1, c1+1, c2, c3, c4, c5)
            cal(now-2, c1, c2+1, c3, c4, c5)
            cal(now-3, c1, c2, c3+1, c4, c5)
            cal(now-4, c1, c2, c3, c4+1, c5)
            cal(now-5, c1, c2, c3, c4, c5+1)

    return 0


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

Submission status: Time Limit Exceeded

Solution code:
X = int(input())


def cal(x, c):
    if x == 0 or x % 100 == 0:
        print(1)
        exit()

    else:
        now = x - 100
        for i in range(1, 6):
            if now < i:
                return 0
            else:
                if c[i] > 19:
                    continue
                else:
                    cal(now-i, c[0:i:]+[c[i]+1]+c[i+1::])
    return 0


if X >= 2000:
    print(1)
else:
    print(cal(X, ([0 for _ in range(6)])))

Submission status: Time Limit Exceeded

Solution code:
X = int(input())


def cal(x, c):
    if x == 0 or x % 100 == 0:
        print(1)
        exit()

    else:
        now = x - 100
        for i in range(1, 6):
            if now < i:
                return 0
            else:
                if c[i] > 19:
                    continue
                else:
                    cal(now-i, c[0:i:]+[c[i]+1]+c[i+1::])
    return 0


if X >= 2000:
    print(1)
else:
    print(cal(X, [0 for _ in range(6)]))

Submission status: Time Limit Exceeded

Solution code:
import copy

X = int(input())


def cal(x, c):
    if x == 0:
        print(1)
        exit()

    else:
        now = x - 100
        for i in range(6):
            if now < i:
                return 0
            else:
                if c[i] > 19:
                    continue
                else:
                    cal(now-i, c[0:i:]+[c[i]+1]+c[i+1::])
    return 0


if X >= 2000:
    print(1)
else:
    print(cal(X, [0 for _ in range(7)]))

Submission status: Time Limit Exceeded

Solution code:
import copy

X = int(input())


def cal(x, c):
    if x == 0:
        print(1)
        exit()

    else:
        now = x - 100
        for i in range(6):
            if now < i:
                return 0
            else:
                if c[i] > 19:
                    continue
                else:
                    c2 = copy.deepcopy(c)
                    c2[i] += 1
                    cal(now-i, c2)
    return 0


if X >= 2000:
    print(1)
else:
    print(cal(X, [0 for _ in range(6)]))

Submission status: Time Limit Exceeded

Solution code:
import sys

x = int(input())

if x >= 2000:
    print(1)
    sys.exit()

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

print(0)

Submission status: Time Limit Exceeded

Solution code:
x=int(input())
while True:
  if x<100:
    print(1)
  elif x in [100,101,102,103,104,105]:
    print(1)
  else:
    y=x//100
    if y*(100)<=x and x<=y*(105):
      print(1)
    else:
      print(0)

Submission status: Time Limit Exceeded

Solution code:
# x <= 2000
# いずれも20個以下になる

import sys

price = int(input())
ans = 0
for a in range(1, 21):
  for b in range(1, 21):
    for c in range(1, 21):
      for d in range(1, 21):
        for e in range(1, 21):
          for f in range(1, 21):
            #print(a, b, c, d, e, f)
            if (a*100 + b*101 + c*102 + d*103 + e*104 + f*105) == price:
              ans = 1
              print(ans)
              sys.exit()
print(0)

Submission status: Time Limit Exceeded

Solution code:
import sys

price = int(input())
ans = 0
for a in range(1, 21):
  for b in range(1, 21):
    for c in range(1, 21):
      for d in range(1, 21):
        for e in range(1, 21):
          for f in range(1, 21):
            #print(a, b, c, d, e, f)
            if (a*100 + b*101 + c*102 + d*103 + e*104 + f*105) == price:
              ans = 1
              print(ans)
              sys.exit()

Submission status: Time Limit Exceeded

Solution code:
X = int(input())

A = X // 100

for i_100 in range(A + 1):
    for i_101 in range(A + 1 - i_100):
        for i_102 in range(A + 1 - i_100 - i_101):
            for i_103 in range(A + 1 - i_100 - i_101 - i_102):
                for i_104 in range(A + 1 - i_100 - i_101 - i_102 - i_103):
                    for i_105 in range(A + 1 - i_100 - i_101 - i_102 - i_103 - i_104):
                        if i_100 + i_101 + i_102 + i_103 + i_104 + i_105 == A:
                            if i_100 * 100 + i_101 * 101 + i_102 * 102 + i_103 * 103 + i_104 * 104 + i_105 * 105 == X:
                                print("1")
                                exit()

print("0")

Submission status: Time Limit Exceeded

Solution code:
price = int(input())
ans = 0
for a in range(1, 21):
  for b in range(1, 21):
    for c in range(1, 21):
      for d in range(1, 21):
        for e in range(1, 21):
          for f in range(1, 21):
            #print(a, b, c, d, e, f)
            if (a*100 + b*101 + c*102 + d*103 + e*104 + f*105) == price:
              ans = 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())

A = X // 100

for i_100 in range(A + 1):
    for i_101 in range(A + 1):
        for i_102 in range(A + 1):
            for i_103 in range(A + 1):
                for i_104 in range(A + 1):
                    for i_105 in range(A + 1):
                        if i_100 + i_101 + i_102 + i_103 + i_104 + i_105 == A:
                            if i_100 * 100 + i_101 * 101 + i_102 * 102 + i_103 * 103 + i_104 * 104 + i_105 * 105 == X:
                                print("1")
                                exit()

print("0")

Submission status: Time Limit Exceeded

Solution code:
import itertools as it

num = int(input())

item_number = num//100

res_list = []
candi_list = list(it.combinations_with_replacement([100, 101, 102, 103, 104, 105], item_number))
candi_ans_list = [sum(item) for item in candi_list]

if num in candi_ans_list:
    print(1)
else:
    print(0)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
flg = False
if X >= 2000:
  print(1)
  flg = True
else:
  for i in range(20):
    for j in range(20):
      for k in range(20):
        for l in range(20):
          for m in range(20):
            for n in range(20):
              if X == 100*i + 101*j + 102*k + 103*l + 104*m + 105*n:
                print(1)
                flg = True
                break

if not flg:
  print(0)

Submission status: Time Limit Exceeded

Solution code:
def check(x, num):
  t100 = 0
  t101 = 0
  t102 = 0
  t103 = 0
  t104 = 0
  t105 = 0
  
  if x == 0:
    return 1
  elif x < 100:
    return 0
  
  if(x>=100):
    t100 = check(x-num,100)
  if(x>=101):
    t101 = check(x-num,101)
  if(x>=102):
    t102 = check(x-num,102)
  if(x>=103):
    t103 = check(x-num,103)
  if(x>=104):
    t104 = check(x-num,104)
  if(x>=105):
    t105 = check(x-num,105)
  #print('A')
  return max([t100,t101,t102,t103,t104,t105])
###########
X = int(input())

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

Submission status: Time Limit Exceeded

Solution code:
x = int(input())

money = {0}

c = 0
d = 0

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

while True:
    if x >= 2000:
        print(1)
        d = 1
        break
    for i in items:
        p = money.copy()
        for j in p:
            money.add(j)
            money.add(j+i)
    c += 1
    if c == x//100:
        break
if d == 0:
    if x in money:
        print(1)
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
l = int(x/105)
u = int(x/100)+1
flag = False
for n in range(l, u):
    for a in range(0, u):
        for b in range(0, u):
            for c in range(0, u):
                for d in range(0, u):
                    for e in range(0, u):
                        for f in range(0, u):
                            if 100*a + 101*b + 102*c + 103*d + 104*e + 105*f == x:
                                #print(a,b,c,d,e,f)
                                flag = True
                                break
                            if flag == True: break
                        if flag == True: break
                    if flag == True: break
                if flag == True: break
            if flag == True: break
        if flag == True: break
    if flag == True: break

if flag:
    print('1')
else:
    print('0')

Submission status: Time Limit Exceeded

Solution code:
x = int(input())

money = {0}

c = 0
d = 0

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

while True:
    if x >= 2000:
        print(1)
        d = 1
        break
    for i in items:
        p = money.copy()
        for j in p:
            money.add(j+i)
    c += 1
    if c == x//100:
        break
if d == 0:
    if x in money:
        print(1)
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
x = int(input())

money = {0}

c = 0

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

while True:
    for i in items:
        p = money.copy()
        for j in p:
            money.add(j+i)
    c += 1
    if c == x//100:
        break

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