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

n = int(input())

seq = (100,101,102,103,104,105)
exists = False
for l in list(itertools.combinations_with_replacement(seq,n//100)):
    if sum(l) == n:
        print('1')
        exists =True
        break
if not exists:
    print('0')

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):
                    for n in range(int((X-100*i-101*j-102*k-103*l-104*m)/105)+1):
                        if 100*i + 101*j + 102*k + 103*l + 104*m + 105*n == X:
                            c = 1
                            
print(c)

Submission status: Time Limit Exceeded

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


def solve(X: int):
    dp = [[False]*(X+1) for _ in range(7)]
    price = [100,101,102,103,104,105]

    for i in range(7):
        dp[i][0] = True

    ## i番目まででjを払えるか
    for i in range(6):
        for j in range(X+1):
            if j >= price[i]:
                for k in range(1,j//price[i]+1):
                    dp[i+1][j] |= dp[i][j] or dp[i][j-k*price[i]]
            else:
                dp[i+1][j] = dp[i][j]

    if dp[6][X]:
        print(1)
    else:
        print(0)

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
amount = 10 ** 6
x = int(input())
cnt = 0
can_buy = 0

xx = x % 100
if x >= 100:
    for i in range(xx + 1):
        for j in range(xx//2 + 1):
            for k in range(xx // 3 + 1):
                for l in range(xx // 4 + 1):
                    for m in range(xx // 5 + 1):
                        if i + 2 * j + 3 * k + 4 * l + 5 * m == xx:
                            rest = x - 101 * i - 102 * j - 103 * k - 104 * l - 105 * m
                            cnt = rest // 100
                            if rest >= 0 and cnt <= amount:
                                can_buy = 1
                                break

print(can_buy)

Submission status: Time Limit Exceeded

Solution code:
import itertools

x = int(input())
max_c = int(x/100)

p_L = [i for i in range(100,106)]
a = list(itertools.combinations_with_replacement(p_L, max_c))

for val in a:
    if sum(val) == x:
        print(1)
        exit()
print(0)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
X_MOD = X % 100
X_DIV = X // 100

import sys
sys.setrecursionlimit(2000)
def dfs(sum_x, cnt_x):
    if cnt_x > X_DIV:
        return False
    if sum_x == X_MOD:
        return True

    
    return dfs(sum_x+1, cnt_x+1) or dfs(sum_x+1, cnt_x+2) or dfs(sum_x+3, cnt_x+1) or dfs(sum_x+4, cnt_x+1) or dfs(sum_x+5, cnt_x+1)
    

ans = int(dfs(0,0))
print(ans)

Submission status: Time Limit Exceeded

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


number = int(x/100)
xn = x-number*100
number = number+1

for i in range(0,number):
    for j in range(0,number-i):
        for k in  range (0,number-i-j):
            for l in range(0,number-i-j-k):
                for m in range(0,number-i-j-k-l):
                    for n in range(0,number-i-j-k-l-m):
                        if j*1+k*2+l*3+m*4+n*5==xn:
                            if i*100+j*101+k*102+l*103+m*104+n*105==x:
                                print(1)
                                sys.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:
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 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:
n=int(input())

for i in range(1000):
  for j in range(1000):
    for k in range(1000):
      for l in range(1000):
        for m in range(1000):
          for n in range(1000):
            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 sys

sys.setrecursionlimit(2000)


def dfs(now):
    if now == x:
        print(1)
        exit()
    elif now > x:
        return False
    for i in range(6):
        if (dfs(now + 100 + i)):
            pass


x = int(input())
if x >= 2100:
    print(1)
else:
    dfs(0)
    print(0)

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
if x >= 2000:
    print(1)
else:
    for i in range(0,21):
        for j in range(0,21):
            for k in range(0,21):
                for l in range(0,21):
                    for m in range(0,21):
                        for n in range(0,21):
                            if 100*i + 101*j + 102*k + 103*l + 104*m + 105*n == x:
                                print(1)
                                exit(0)
                            else:
                                pass
    print(0)

Submission status: Time Limit Exceeded

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

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


number = int(x/100)
xn = x-number*100
number = number+1

for i in range(0,number):
    for j in range(0,number):
        for k in  range (0,number):
            for l in range(0,number):
                for m in range(0,number):
                    for n in range(0,number):
                        if j*1+k*2+l*3+m*4+n*5==xn:
                            if i*100+j*101+k*102+l*103+m*104+n*105==x:
                                print(1)
                                sys.exit()
print(0)

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/101)+1):
        for k in range(int(X/102) +1):
            for l in range(int(X/103) +1):
                for m in range(int(X/104)+1):
                    for n in range(int(X/105)+1):
                        if 100*i + 101*j + 102*k + 103*l + 104*m + 105*n == X:
                            c = 1
                            
print(c)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())

flag = 0

for a in range(int(X/100)+1):
	for b in range(int(X/100)+1):
		for c in range(int(X/100)+1):
			for d in range(int(X/100)+1):
				for e in range(int(X/100)+1):
					for f in range(int(X/100)+1):
						if 100*a + 101*b + 102*c + 103*d + 104*e + 105*f == X:
							flag = 1
							break
						else:
							continue

print(flag)

Submission status: Time Limit Exceeded

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):
                 for o in range(n):
                    c = 100*i + 101*j + 102*k + 103*l + 104*m + 105*o
                    if c == x:
                      print(1)
                      exit()
print(0)

Submission status: Time Limit Exceeded

Solution code:
import math

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
arr=[100, 101, 102, 103, 104, 105]
k=int(input())
result=""
loop1(0, k, [])
if result=="":
  print(0)
else:
  print(1)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
Max = 1000000
for i in range(Max):
  if X < (100*i):
    continue
  for j in range(Max):
    if X < (100*i + 101*j):
      continue
    for k in range(Max):
      if X < (100*i + 101*j + 102*k):
        continue
      for l in range(Max):
        if X < (100*i + 101*j + 102*k * 103*l):
          continue
        for m in range(Max):
          for n in range(Max):
            if X == (100*i + 101*j + 102*k + 103*l + 104*m * 105*n):
              print(1)
print(0)

Submission status: Time Limit Exceeded

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 = [100, 101, 102, 103, 104, 105]

res = a( goods, x, True)
print(1) if len(res)>0 else 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()
flag = [False]

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())
X_MOD = X % 100
X_DIV = X // 100
def bfs():
    
    from collections import deque
    queue = deque([(0, 0)])
    while queue:
        sum_x, cnt_x = queue.popleft()
        #print(sum_x, cnt_x)
        if sum_x == X_MOD:
            return 1
        if sum_x > X_MOD:
            continue
        if cnt_x == X_DIV:
            continue

        queue.append((sum_x + 1,cnt_x+1))
        queue.append((sum_x + 2,cnt_x+1))
        queue.append((sum_x + 3,cnt_x+1))
        queue.append((sum_x + 4,cnt_x+1))
        queue.append((sum_x + 5,cnt_x+1))
    return 0

ans = bfs()
print(ans)

Submission status: Time Limit Exceeded

Solution code:
x = int(input()) #1<=x<=100000
#100-105
flg = False

buf1 = x
for i in range(int(buf1/105)+1):
  buf2=x-105*i
  for j in range(int(buf2/104)+1):
    buf3=x-105*i-104*j
    for k in range(int(buf3/103)+1):
      buf4=x-105*i-104*j-103*k
      for l in range(int(buf4/102)+1):
        buf5=x-105*i-104*j-103*k-102*l
        for m in range(int(buf5/101)+1):
          buf6=x-105*i-104*j-103*k-102*l-101*m
          if buf6%100==0:
            flg = True
if flg:
  print(1)
else:
  print(0)

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
item_list = [100,101,102,103,104,105] * 1000
def part_sum(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]

print(part_sum(item_list,x))

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
N = X//100
def get_change(pay, N):
    if N >= 0:
        for n in range(6):
            if pay%(100+n) == 0:
                print(1)
                exit(0)
            if pay > 100+n:
                get_change(pay-100-n, N-1)
    return 2
res = get_change(X, N)
if res == 2:
    print(0)

Submission status: Time Limit Exceeded

Solution code:
import sys
import itertools

input = sys.stdin.readline
X = int(input())
#a = [int(i) for i in input().split()] 
#e = [[int(i) for i in input().split()] for i in range(n)] 

maxtimes = int(X/100)+1
pools = itertools.product(range(maxtimes), repeat=6)

for comb in pools:
    c = list(comb)
    price = c[0]*100+c[1]*101+c[2]*102+c[3]*103+c[4]*104+c[5]*105
    if price == X:
        print(1)
        exit()

print(0)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())

def bfs():
    from collections import deque
    queue = deque([0])
    while queue:
        sum_x = queue.popleft()
        if sum_x == X:
            return 1
        if sum_x > X:
            continue

        queue.append(sum_x + 100)
        queue.append(sum_x + 101)
        queue.append(sum_x + 102)
        queue.append(sum_x + 103)
        queue.append(sum_x + 104)
        queue.append(sum_x + 105)
    return 0

ans = bfs()
print(ans)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())

def get_change(pay):
    for n in range(6):
        if pay%(100+n) == 0:
            print(1)
            exit(0)
        if pay > 100+n:
            get_change(pay-100-n)
    return 2
res = get_change(X)
if res == 2:
    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**6)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

x = INT()
flag = [False]

def dfs(cur):
    if cur==x:
        flag[0] = True
        return 0
    if cur>x:
        return 0
    dfs(cur+100)
    dfs(cur+101)
    dfs(cur+102)
    dfs(cur+103)
    dfs(cur+104)
    dfs(cur+105)

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

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
from itertools import combinations_with_replacement

x = int(stdin.readline().rstrip())

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

kosuu = x//100
amari = x%100

lin = list(combinations_with_replacement(li, kosuu))

for i in lin:
    if sum(i) == amari:
        print(1)
        exit()

print(0)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

import sys
sys.setrecursionlimit(10 ** 9)

def dfs(x):
    ans = False
    if x == 0:
        return True
    elif x < 0:
        return False
    else:
        ans |= dfs(x - 100)
        ans |= dfs(x - 101)
        ans |= dfs(x - 102)
        ans |= dfs(x - 103)
        ans |= dfs(x - 104)
        ans |= dfs(x - 105)

    return ans
if dfs(N):
    print(1)
else:
    print(0)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
Max = 1000000
for i in range(Max):
  for j in range(Max):
    for k in range(Max):
      if X < (100*i + 101*j + 102*k):
        continue
      for l in range(Max):
        for m in range(Max):
          for n in range(Max):
            if X == (100*i + 101*j + 102*k + 103*l + 104*m * 105*n):
              print(1)
print(0)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())

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


def dfs(zan):
    if zan <= 0:
        if zan == 0:
            print(1)
            exit()
        else:
            return

    dfs(zan - 100)
    dfs(zan - 101)
    dfs(zan - 102)
    dfs(zan - 103)
    dfs(zan - 104)
    dfs(zan - 105)


dfs(X)
print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
from math import gcd,pi,sqrt
INF = float("inf")
MOD = 10**9 + 7

import sys
sys.setrecursionlimit(10**6)
import itertools
import bisect
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    X = i_input()

    Y = X//100
    L = []
    a = [0,1,2,3,4,5]
 
    for i in range(1,min(20,Y)+1):
        c = list(itertools.combinations_with_replacement(a, i))
        for i in c:
            L.append(sum(i))
    Z = X%100
 
    if Z in L:
        print(1)
    else:
        print(0)


  
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
X = int(input())
# dp[i]:= ちょうどi円となる買い物が存在するorしない
dp = [0] * (X+1)
dp[0] = 1
for i in range(X):
    if dp[i] == 1:
        for next in [100,101,102,103,104,105]:
            if i+next<=X:
                dp[i+next] = 1
print(dp[X])

Submission status: Accepted

Solution code:
x = int(input())

if x >= 2000:
    print(1)
    exit()
    
for i in range(1, 20):
    if (100 * i <= x) and (x <= 105 * i):
        print(1)
        exit()
print(0)

Submission status: Accepted

Solution code:
X = int(input())
for i in range(1, 10**10):
  if 100*i <= X <= 105*i:
    print(1)
    break
  elif X < 100*i:
    print(0)
    break

Submission status: Accepted

Solution code:
x = int(input())

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 (1)
else:
    for i in range(100000):
        if 100*i <= x <= 105*i:
            print (1)
            exit ()
    else:
        print (0)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

X = int(input())

num = X // 100
if num*100 <= X and X<=num*105:
    print("1")
else:
    print("0")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

X = int(input())

num = X // 100
reminder = X % 100
if reminder == 0:
    print("1")
    exit()

for i in range(num+1):
    for j in range(num+1):
        if i+j > num:
            continue
        for k in range(num+1):
            if i+j+k > num:
                continue
            for l in range(num+1):
                if i+j+k+l>num:
                    continue
                for m in range(num+1):
                    if i+j+k+l+m>num:
                        continue

                    res = i*1+j*2+k*3+l*4+m*5
                    if res == reminder:
                        print("1")
                        exit()

print("0")

Submission status: Accepted

Solution code:
DP = [False]*100001
DP[0] = True
for TN in range(0,100001):
    if TN>=100 and DP[TN-100]:
        DP[TN] = True
        continue
    if TN>=101 and DP[TN-101]:
        DP[TN] = True
        continue
    if TN>=102 and DP[TN-102]:
        DP[TN] = True
        continue
    if TN>=103 and DP[TN-103]:
        DP[TN] = True
        continue
    if TN>=104 and DP[TN-104]:
        DP[TN] = True
        continue
    if TN>=105 and DP[TN-105]:
        DP[TN] = True
        continue
print([0,1][DP[int(input())]])

Submission status: Accepted

Solution code:
X = int(input())

count = 1
while True:
  if 100*count <= X <= 105*count:
    print(1)
    exit()
  elif X < 100*count:
    print(0)
    exit()
  count += 1

Submission status: Accepted

Solution code:
x = int(input())

can = x // 100
need = ((x%100) + 4) // 5

print(1 if can >= need else 0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

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

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
X = int(input())
dp = [True] + [False] * (X)

if X < 106:
  if 100 <= X <= 105:
    print(1)
    exit()
  else:
    print(0)
    exit()


# 100~105円はyes
for i in range(100,106):
  dp[i] = True

for i in range(106,X+1):
  for j in range(100,106):
    if dp[i-j] == True:
      dp[i] = True
      break

print(1 if dp[X] == True else 0)

Submission status: Accepted

Solution code:
x=int(input())
c=(x+100-1)//100
# print(c)
for i in range(1,c+1):
    if 100*i<=x<=105*i:
        print(1)
        exit()
else : print(0)

Submission status: Accepted

Solution code:
x = int(input())
a = x//100
b = x%100
if b <= 5*a:
    print(1)
    exit()
print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
print(1 if x-x//100*100 <= x//100*5 else 0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
m = n//100
a = n%100
if a > m*5:
  print(0)
else:
  print(1)

Submission status: Accepted

Solution code:
# coding: utf-8


def main():
    X = int(input())
    C = X // 100
    print([0, 1][X >= C * 100 and X <= C * 105])


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# DP解

x = int(input())
dp = [False for _ in range(x+1)]
dp[0] = True

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

for i in range(1, 100):
    dp[i] = False
for i in range(100, x+1):
    tmp = False
    for j in range(6):
        if i-(100+j) >= 0:
            tmp = (tmp or dp[i-(100+j)])
    if tmp:
        dp[i] = True
    else:
        dp[i] = False

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python

x = int(input())

n = x//100

for i in range(n+1):
    tmp = x 
    tmp -= i*100
    if 5*i >= tmp:
        print(1)
        exit()
print(0)

Submission status: Accepted

Solution code:
N = int(input())
a = N // 100
if 0 <= N - 100 * a <= 5 * a:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
n=int(input())
dp=[0]*(n+120)
dp[100]=1
dp[101]=1
dp[102]=1
dp[103]=1
dp[104]=1
dp[105]=1

for i in range(100,n+1):
    if not dp[i]: continue
    dp[i+100:i+106]= [1]*6
print(dp[n])

Submission status: Accepted

Solution code:
x = int(input())
d = x%100
c = 0
for i in [5,4,3,2,1]:
    c += d//i
    d = d%i
if c*100 + x%100 > x:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
X = int(input())

dp = [0] * 110000
dp[100] = 1
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(X + 1):
    dp[i + 100] = max(dp[i], dp[i + 100])
    dp[i + 101] = max(dp[i], dp[i + 101])
    dp[i + 102] = max(dp[i], dp[i + 102])
    dp[i + 103] = max(dp[i], dp[i + 103])
    dp[i + 104] = max(dp[i], dp[i + 104])
    dp[i + 105] = max(dp[i], dp[i + 105])

print(dp[X])

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

x = int(input())

def cond(x):
    q, r = x // 100, x % 100
    q5, r5 = r // 5, r % 5
    if r5 == 0:
        return q >= q5
    else:
        return q >= q5 + 1

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

Submission status: Accepted

Solution code:
X=int(input())

ns=X//105
ne=X//100


ans=0
for i in range(ns, ne+1):
    if 100*i<=X<=100*i+5*i:
        ans=1
        break
print(ans)

Submission status: Accepted

Solution code:
import math
a = input()
X = int(a)

b = X // 100

if b*100 <= X and X <= b*105:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
import math

x = int(input())
a = x // 100
b = x % 100
print(1) if b <= 5*a else print(0)

Submission status: Accepted

Solution code:
x = int(input())
dp = [False]*101000
dp[0] = True
l = [100, 101, 102, 103, 104, 105]
for i in range(100001):
  for j in l:
    if dp[i]:
      dp[i+j] = True
if dp[x]:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    for i in range(1000):
        if 100*i <= X <= 105*i:
            print(1)
            return
    print(0)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#
# smbc2019 c
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """615"""
        output = """1"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """217"""
        output = """0"""
        self.assertIO(input, output)


def resolve():
    X = int(input())

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


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Accepted

Solution code:
x = int(input())
xd = x//100
if xd*100 <= x <= xd*105:
  print(1)
else:
  print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

num = X // 100 + 1
calc = X % 100

for a in range(num):
    for b in range(num - a):
        for c in range(num - a - b):
            for d in range(num - a - b - c):
                for e in range(num - a - b - c - d):
                    for f in range(num - a - b - c - d - e):
                        if calc == 0*a + 1*b + 2*c + 3*d + 4*e + 5*f:
                            print(1)
                            exit()


print(0)

Submission status: Accepted

Solution code:
x = int(input())
q,r = divmod(x, 100)
if r <= q*5:
    print(1)
else:
    print(0)

Submission status: Accepted

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()

def resolve():
    import sys
    input = sys.stdin.readline

    x = int(input().rstrip())

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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
X=int(input())

if 1<=X<100 or 106<=X<200 or 211<=X<300 or 316<=X<400 or 421<=X<500 or 526<=X<600 or 631<=X<700 or 736<=X<800 or 841<=X<900 or 946<=X<1000 or 1051<=X<1100 or 1156<=X<1200 or 1261<=X<1300 or 1366<=X<1400 or 1471<=X<1500 or 1576<=X<1600 or 1681<=X<1700 or 1786<=X<1800 or 1891<=X<1900 or 1996<=X<2000:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
X=int(input())

n = X//100

if X in range(n*100,n*105+1):
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
n=int(input())
oh=n//100
te=n%100
if oh*5<te:
    print(0)
else:
    print(1)

Submission status: Accepted

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

dp = [0]*(100010)
lst = [100,101,102,103,104,105]
for i in range(100,106):
    dp[i] = 1

# dp[v] が存在するなら 1, しないなら 0
for v in range(100,X+1):
    for w in range(6):
        n = lst[w]
        if dp[v-n] == 1:
            dp[v] = 1
print(dp[X])

Submission status: Accepted

Solution code:
x=int(input())
data=[100,101,102,103,104,105]
dp=[0]*(x+1)
dp[0]=1
for i in data:
  for j in range(i,x+1):
    if dp[j-i]==1:
      dp[j]=1
print(dp[x])

Submission status: Accepted

Solution code:
x = int(input())
dp = [0]*(x + 105 + 1)
dp[100] = 1 
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100,x+1):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print(dp[x])

Submission status: Accepted

Solution code:
x = int(input())
dp = [0]*(x + 105 + 1)
dp[100] = 1 
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100,x-105+6):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print(dp[x])

Submission status: Accepted

Solution code:
x = int(input())
dp = [0]*(x + 105 + 1)
dp[100] = 1 
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100,x-105+12):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print(dp[x])

Submission status: Accepted

Solution code:
x = int(input())
dp = [0]*(x + 105 + 1)
dp[100] = 1 
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100,x-105+25):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print(dp[x])

Submission status: Accepted

Solution code:
x = int(input())
dp = [0]*(x + 105 + 1)
dp[100] = 1 
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100,x-105+50):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print(dp[x])

Submission status: Accepted

Solution code:
x = int(input())
dp = [0]*(x + 105 + 1)
dp[100] = 1 
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100,x-105+100):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print(dp[x])

Submission status: Accepted

Solution code:
x = int(input())
dp = [0]*(x+105+1)
dp[100] = 1 
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100,x+1):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print(dp[x])

Submission status: Accepted

Solution code:
n = int(input())
a = n // 100
b = n % 100

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

Submission status: Accepted

Solution code:
x = int(input())
a = x % 100
b = x // 100
cnt = 0
ans = 0

for i in [5,4,3,2,1]:
    cnt += a // i
    a %= i
    
if cnt <= b:
    ans = 1
    
print(ans)

Submission status: Accepted

Solution code:
x = int(input())
cx = int(x/100)
dx = x%100
while cx>0:
    cx-=1
    if dx>5:
        dx-=5
    else:
        print(1)
        exit()
print(0)