Problem:


Score: 300 points

Problem Statement

AtCoder Mart sells 1000000 of each of the six items below:

Riceballs, priced at 100 yen (the currency of Japan) each

Sandwiches, priced at 101 yen each

Cookies, priced at 102 yen each

Cakes, priced at 103 yen each

Candies, priced at 104 yen each

Computers, priced at 105 yen each

Takahashi wants to buy some of them that cost exactly X yen in total.
Determine whether this is possible.

(Ignore consumption tax.)

Constraints

1 \leq X \leq 100000

X is an integer.

Input

Input is given from Standard Input in the following format:

X

Output

If it is possible to buy some set of items that cost exactly X yen in total, print 1; otherwise, print 0.

Sample Input 1

615

Sample Output 1

1

For example, we can buy one of each kind of item, which will cost 100+101+102+103+104+105=615 yen in total.

Sample Input 2

217

Sample Output 2

0

No set of items costs 217 yen in total.



Sample input:
615


Sample output:
1

Submission status: Wrong Answer

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt, ceil
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# 2数の最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

# リストの要素の最小公倍数
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

# リストの要素の最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

# 素数判定
def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True


# limit以下の素数を列挙
def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

# 同じものを含む順列
def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        # set（集合）型で重複を削除、ソート
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret


# ここから書き始める
def main(x):
    p = [100, 101, 102, 103, 104, 105]
    dp = [[0 for j in range(100001)] for i in range(6)]
    for i in range(6):
        if i == 0:
            dp[i][0] = 1
            dp[i][p[i]] = 1
            continue
        for j in range(100001):
            dp[i][j] = dp[i - 1][j]
            if 0 <= j - p[i] < 100001 and dp[i - 1][j - p[i]] == 1:
                dp[i][j] = 1
    return dp[- 1][x]

x = int(input())
print(main(x))

Submission status: Wrong Answer

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt, ceil
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# 2数の最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

# リストの要素の最小公倍数
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

# リストの要素の最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

# 素数判定
def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True


# limit以下の素数を列挙
def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

# 同じものを含む順列
def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        # set（集合）型で重複を削除、ソート
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret


# ここから書き始める
def main(x):
    p = [100, 101, 102, 103, 104, 105]
    dp = [[0 for j in range(100001)] for i in range(6)]
    for i in range(6):
        if i == 0:
            dp[i][p[i]] = 1
            continue
        for j in range(100001):
            dp[i][j] = dp[i - 1][j]
            if 0 <= j - p[i] < 100001 and dp[i - 1][j - p[i]] == 1:
                dp[i][j] = 1
    return dp[- 1][x]

x = int(input())
print(main(x))

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    for i in range(1001):
        for x in range(6):
            if 100*i+i*x==n:
                print(1)
                sys.exit()
    else:print(0)


if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    n=s[0]
    if int(s)<100:
        print(0)
        sys.exit()
    if int(s[1:3])<=int(n)*5 and (len(s)==3 or int(s[3:])==0):
        print(1)
    else:print(0)

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    n=s[0]
    if int(s)<100:
        print(0)
        sys.exit()
    if int(s[1:3])<=int(n)*5:print(1)
    else:print(0)

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
X=int(input())
ans=0
for i in range(X//100):
    for j in range(X//100):
        for k in range(X//100):
            for l in range(X//100):
                for m in range(X//100):
                    for n in range(X//100):
                        if 100*i+101*j+102*k+103*l+104*m+105*n==X:
                            ans=1
                            break
                        elif 100*i+101*j+102*k+103*l+104*m+105*n>X:
                            break
                    if ans!=0:
                        break
                if ans!=0:
                    break
            if ans!=0:
                break
        if ans!=0:
            break
    if ans!=0:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

dp = [0 for _ in range(x + 1)] #0:"No", 1:"Yes"
dp[0] = 1
if x < 100:
    for i in range(100, min(x,106)):
        dp[i] = 1
    if x >= 106:
        for i in range(106, x + 1):
            if dp[i-100] == 1 or dp[i-101] == 1 or dp[i-102] == 1 or dp[i-103] == 1 or dp[i-104] == 1 or dp[i-105] == 1:
                dp[i] = 1
print(dp[x])

Submission status: Wrong Answer

Solution code:

def myAnswer(X:int)-> int:
   if(X < 100) : return 0
   total = 0
   first = X % 10
   secand = ((X // 10) % 10) *10
   if(first <=5 and first >=0):
      total += 100+first
   else:
      total += 200 + first
   total += (secand//5)*105
   return 1 if(total <= X) else 0



def modelAnswer():
   tmp=1
def main():
   X = int(input())
   print(myAnswer(X))

if __name__ == '__main__':
   main()

Submission status: Wrong Answer

Solution code:
def myAnswer(X:int)-> int:
   if(X < 100) : return 0
   total = 0
   first = X % 10**(len(str(X)) - 2)
   secand = X % 10**(len(str(X)) - 1) - first
   if(first <=5 and first >=0):
      total += 100+first
   else:
      total += 200 + first
   total += (secand//5)*105
   return 1 if(total <= X) else 0



def modelAnswer():
   tmp=1
def main():
   X = int(input())
   print(myAnswer(X))

if __name__ == '__main__':
   main()

Submission status: Wrong Answer

Solution code:
import math
X=int(input())
under = math.floor(X / 105)
top = math.floor(X/100)
#print("under,top = {},{}".format(under,top))
if top - under > 0:
    print("1")
else:
    print("0")
#for i in range(under, top + 1):

Submission status: Wrong Answer

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

if 100 <= x and 0 <= x % 10 <= 5:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

if 100 <= x and 0 <= x % 100 <= 5:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

if 0 <= x % 100 <= 5:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
X = int(input())
flag = 0
for C in range(X+1):
  if 100*C <= X and 105*C >= X:
    flag += 1
print(flag)

Submission status: Wrong Answer

Solution code:
X = int(input())
flag = 0
for C in range(X):
  if 100*C <= X and 105*C >= X:
    flag += 1
print(flag)

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
import math

N = input()

if int(N) <= 100:
    print("0")
    sys.exit()

if int(N) % 100 == 0:
    print("1")
    sys.exit()

tmp = (int(N) - (int(N)//100)*100)

if tmp <= 5:
    print("1")
    sys.exit()

tmp2 = (tmp//5)
tmp3 = tmp % 5

if int(N) <= ((int(N)//100)*100) + tmp2*105 + (100 + tmp3):
    print("0")
else:
    print("1")

Submission status: Wrong Answer

Solution code:
import sys
import math

N = input()

if int(N) <= 100:
    print("0")
    sys.exit()

if int(N) % 100 == 0:
    print("1")
    sys.exit()

tmp = (int(N) - (int(N)//100)*100)

if tmp <= 5:
    print("1")
    sys.exit()

tmp2 = (tmp//5)
tmp3 = tmp % 5

if int(N) <= tmp2*105 + (100 + tmp3):
    print("0")
else:
    print("1")

Submission status: Wrong Answer

Solution code:
import sys
import math

N = input()

if int(N) <= 100:
    print("0")
    sys.exit()

if int(N) % 100 == 0:
    print("1")
    sys.exit()

tmp = (int(N) - (int(N)//100)*100)

if tmp <= 5:
    print("1")
    sys.exit()

tmp2 = math.ceil(tmp/5)

if int(N) <= tmp2*105:
    print("0")
else:
    print("1")

Submission status: Wrong Answer

Solution code:
import sys
import math

N = input()

if int(N) <= 100:
    print("0")
    sys.exit()

if int(N) % 100 == 0:
    print("1")
    sys.exit()

tmp = 0
for i in range(1,len(N)):
    if (N[i]) != "0":
        tmp = int(N[i:len(N)])
        break

if tmp <= 5:
    print("1")
    sys.exit()

tmp2 = math.ceil(tmp/5)

if int(N) <= tmp2*105:
    print("0")
else:
    print("1")

Submission status: Wrong Answer

Solution code:
X = int(input())

i = 0
dp = [0]*X
dp[0] = 1
for i in range(100, X):
    for j in range(6):
        if dp[i-(100+j)] == 0:
            pass
        else:
            dp[i] = 1
print(dp[X-1])

Submission status: Wrong Answer

Solution code:
X = int(input())
DP = [[0]*(X+1) for i in range(6)]
A = [100+i for i in range(6)]
DP[0][0] = 1
for i in range(6):
    for x in range(X+1):
        if i==0:
            if x>=100:
                DP[i][x] = DP[i][x-100]
        else:
            a = A[i]
            DP[i][x] = DP[i-1][x]
            if x>a:DP[i][x] = max(DP[i][x],DP[i][x-a])
print(DP[5][X])

Submission status: Wrong Answer

Solution code:
n = int(input())

cent = n//100
under_cent = n%100

print(cent)
print(under_cent)

if under_cent > cent*5:
  print(0)
else:
  print(1)

Submission status: Wrong Answer

Solution code:
X = int(input())
if X >2000:
  print("1")
else:
  for i in range(1,20,1):
    if not (X in range(100*i,105*i +1)) == False:
      print("0")
      break
    else:
      print("1")

Submission status: Wrong Answer

Solution code:
X = int(input())
if X >2000:
  print("1")
else:
  for i in range(1,20,1):
    if not (X in range(100*i,105*i +1)) == False:
      print("1")
      flag = True
      break
    else:
      print("0")

Submission status: Wrong Answer

Solution code:
X = int(input())

flag = False
for i in range(1,20,1):
  if not (X in range(100*i,105*i +1)) == False:
    print("1")
    
    flag = True
    break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
for c in range(x+1):
  l = 100*c
  r = 105*c
  if l <= x <= c:
    print(1)
    exit()
else:
  print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def dp(n):
  if n<100:
    return 0
  if 100<=n and n<=105:
    return 1
  res = 0
  for i in range(100,106):
    res |= DP[n-i]
  return res

for i in range(X+1):
  DP[i] = dp(i)
ans=DP[X]
print(DP)
print(ans)

#print(*ans, sep='/n')

Submission status: Wrong Answer

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

def dp(n):
  if n<100:
    return 0
  if 100<=n and n<=105:
    return 1
  res = 0
  for i in range(100,106):
    res |= DP[n-i]
  return res

for i in range(X):
  DP[i] = dp(i)
ans=DP[X]
#print(DP)
print(ans)

#print(*ans, sep='/n')

Submission status: Wrong Answer

Solution code:
X = int(input())
DP=[0]*X

def dp(n):
  if n<100:
    return 0
  if 100<=n and n<=105:
    return 1
  res = 0
  for i in range(100,106):
    res |= DP[n-i]
  return res

for i in range(X):
  DP[i] = dp(i)
ans=DP[X-1]

print(ans)

#print(*ans, sep='/n')

Submission status: Wrong Answer

Solution code:
X = int(input())
X %= 105
X %= 104
X %= 103
X %= 102
X %= 101
X %= 100
print(X == 0)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 0
while 105 * i <= n:
  i += 1
if 100 * i <= n:
  print(1)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
def main():
    target = int(input())
    cost = [101, 102, 103, 104, 105]
    answer = False
    if target % 100:
        for i in range(1, 32):
            choice = bin(i)[2:].zfill(5)
            result = 0
            for j in range(5):
                result += cost[j] * int(choice[j])
            if ((target % 100) % (result % 100) == 0 and sum(cost) <= target) or\
                    ((result % 100) % (target % 100) == 0 and target < sum(cost)):
                answer = True
                break
    else:
        answer = True
    print(1 if answer else 0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    target = int(input())
    cost = [101, 102, 103, 104, 105]
    answer = False
    for i in range(32):
        choice = bin(i)[2:].zfill(5)
        result = 0
        for j in range(5):
            result += cost[j] * int(choice[j])
        if target % 100 == result % 100 and result <= target:
            answer = True
            break
    print(1 if answer else 0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(100000):
    if(100*i <= x and 105*i >= x):
        print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
X = list(input())
if len(X)<=2:
    print(-1)
    exit()
con = X[len(X)-2:len(X)]
kak = X[0:len(X)-2]
kak = int("".join(kak))
con = int("".join(con))
if con>=5:
    imp1 = con//5
    imp2 = con%5
else:
    imp1 = 1
    imp2 = 0
#print(kak, imp1, imp2)
if kak>=imp1+imp2:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
L = [i for i in range(100,2001,100)]
#print(L)
LL = []
for i in L:
    n1 = int(str(i)[0])
    n2 = int(str(i)[0]+str(i)[1])
    len1 = len(str(i))
    if len1 == 3:
        LL.append((n1*100+5*n1+1,(n1+1)*100-1))
    else:
        LL.append((n2*100+5*(n2)+1,(n2+1)*100-1))
LL = [(1,99)] + LL
LL.pop()
print(LL)
for i in range(len(LL)):
    if LL[i][0] <= n <= LL[i][1]:
        print(0)
        exit()
print(1)

Submission status: Wrong Answer

Solution code:
n = int(input())
L = [i for i in range(100,2001,100)]
#print(L)
LL = []
for i in L:
    n1 = int(str(i)[0])
    n2 = int(str(i)[0]+str(i)[1])
    len1 = len(str(i))
    if len1 == 3:
        LL.append((n1*100+5*n1+1,(n1+1)*100-1))
    else:
        LL.append((n2*100+5*(n2),(n2+1)*100-1))
LL = [(1,99)] + LL
LL.pop()
#print(LL)
for i in range(len(LL)):
    if LL[i][0] <= n <= LL[i][1]:
        print(0)
        exit()
print(1)

Submission status: Wrong Answer

Solution code:
x = int(input())

p = x%100
n = (x-p)//100
b = 0
for i in range(n):
    if b==1:
        break
    for j in range(i,n):
        if b==1:
            break
        for k in range(j,n):
            if b==1:
                break
            for l in range(k,n):
                if b==1:
                    break
                for m in range(l,n):
                    if i + 2*j + 3*k + 4*l + 5*m == p:
                        print(1)
                        b =1
                        break
if b==0:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
a = [100, 101, 102, 103, 104, 105]
for i in range(200, x + 1):
    for j in range(100, int(i / 2 + 1)):
        if j in a and i - j in a:
            a.append(i)
            continue
print(int(a[-1] == x))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

q = x // 100
r = x % 100

if 0 <= q and q <= 5*r:
  print(1)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
h = x // 100
t = x - h * 100
o = t % 10
t = t // 10
cost = 0
cost += (t * 2)
if 0 <= o <= 5:
    cost += 1
else:
    cost += 2
if cost <= h:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
X = int(input())

r = X % 100
q = X // 100
n = 0
for i in range(5, 1, -1):
    while r % i == 0:
        r /= i
        n += 1
if r:
    n += r
print(1 if n <= q else 0)

Submission status: Wrong Answer

Solution code:
X=int(input())
Y=X%100
Z=X//100
if X>(Z*5):
	print(0)
else:
	print(1)

Submission status: Wrong Answer

Solution code:
x=int(input())
if x<100:
  print(0)
  exit()
elif 100<=x<=106:
  print(1)
  exit()
else:
  DP=[False]*(x+1)
  for i in range(x+1):
    coin=list(range(100,106,1))
    if i in coin:
      DP[i]=True
      continue
    DP[i]=True if any(DP[i-m] for m in coin) else False
  print(1 if DP[x]==True else 0)

Submission status: Wrong Answer

Solution code:
x = int(input())

u = x % 100
r = x // 100
isOk = False
for i in range(r):
    if u <= 0:
        isOk = True
        break
    u -= 5
print("01"[isOk])

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

X = int(input())

dp = [False] * (X+1)
dp[0]=True

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

for i in range(len(c)):
	cnt = 0
	for j in range(c[i],X+1):
		if(dp[j-c[i]] and cnt <= 100000):
			dp[j]=True
			cnt+=1
print(dp[X])

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)

def new(t):
    for r in t:
        tmp = []
        for b in [100, 101, 102, 103, 104, 105]:
            nex = r - b
            if nex == 0 or r % b == 0:
                return 1
            elif nex < 100:
                return 0
            tmp.append(nex)
        t = tmp
    # print(t, tmp)
    return new(t)
        

def main():
    x = ni()

    t = [x]
    return new(t)
    

if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

Solution code:
n = int(input())
#indexが負の場合、末尾から参照されるので多めにとる
dp = [0]*100200
dp[0] = 1
for i in range(0,100000):
    if dp[i-105]:
        dp[i] = 1
    if dp[i-104]:
        dp[i] = 1
    if dp[i-103]:
        dp[i] = 1
    if dp[i-102]:
        dp[i] = 1
    if dp[i-101]:
        dp[i] = 1
    if dp[i-100]:
        dp[i] = 1

print(dp[n])

Submission status: Wrong Answer

Solution code:
X = int(input())
x = X % 100
A, a = x // 5, x % 5
B, b = a // 4, a % 4
C, c = b // 3, b % 3
D, d = c // 2, c % 2
E = d % 2
print(X,x,A,B,C,D,E)
if(X - X % 100 >= 100 * (A + B + C + D + E)):
  print(1)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
X = int(input())
Y = X % 100
A, a = Y // 5, Y % 5
B, b = A // 4, A % 4
C, c = B // 3, B % 3
D, d = C // 2, C % 2
E = D % 2
if(X - X % 100 >= 100 * (A + B + C + D + E)):
  print(1)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
x=int(input())
y=1  # y個購入すると題意をみたす時、1<=y<=x//100、実際に支払い可能な金額は100＊y〜105＊y
if x<100:
  print(0)
while y<=x//100:
  if y*100<=x<=y*105:
    print(1)
    break
  elif y>x//100:
      print(0)
  else:
    y+=1

Submission status: Wrong Answer

Solution code:
x=int(input())
y=1  # y個購入すると題意をみたす時、1<=y<=x//100、実際に支払い可能な金額は100＊y〜105＊y
while y<=x//100:
  if y*100<=x<=y*105:
    print(1)
    break
  else:
    y+=1
    if y>x//100:
      print(0)

Submission status: Wrong Answer

Solution code:
x=int(input())
a=b=c=d=e=f=0
flag=False
for a in range(x//100):
  for b in range(x//101):
    for c in range(x//102):
      for d in range(x//103):
        for e in range(x//104):
          for f in range(x//105):
            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: Wrong Answer

Solution code:
X = int(input())
X_ = X % 101
N = int(X / 101)
ans = 0
for i in range(5):
    X_ -= N

if X_ > 0:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
X = int(input())
X_ = X % 101
N = X // 101
ans = 0
for i in range(6):
        X_ -= N

if X_ > 0:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
X = int(input())
X_ = X % 101
N = X // 101
ans = 0
for i in range(6):
    if X_ > N:
        X_ -= N
    else:
        print(1)
        break
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import sys
import math
import numpy as np
import scipy as sp
input = sys.stdin.readline

X = input()
if len(X) <= 2:
    print(0)
    sys.exit()
count = int(X[0])
num = int(X[1:])
for a in range(count):
    for b in range(count-a):
        for c in range(count-a-b):
            for d in range(count-a-b-c):
                for e in range(count-a-b-c-d):
                    for f in range(count-a-b-c-d-e):
                        li = [a,b,c,d,e,f]
                        tmp = 0
                        for i,l in enumerate(li):
                            tmp += l * i
                        if tmp == num:
                            print(1)
                            sys.exit()
print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a = int(input())
b = a % 100
c = a // 100
for i in range(c):
    if b == 0:
        print(1)
        break
    for j in range(5, 0, -1):
        if b >= j:
            b -= j
            break
else:
    print(0)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = a % 101
c = a // 101
for i in range(c):
    if b == 0:
        print(1)
        break
    for j in range(4, 0, -1):
        if b >= j:
            b -= j
            break
else:
    print(0)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = a % 101
c = a // 101
for i in range(c):
    if b == 0:
        print(1)
        break
    for j in range(5, 0, -1):
        if b >= j:
            b -= j
            break
else:
    print(0)

Submission status: Wrong Answer

Solution code:
X=int(input())
r=[100,101,102,103,104,105]
setval=0
bfound=False
for i in r:
    setval=setval+i
    if X%setval==0:
        bfound=True
    else:
        bfound=False 

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

Submission status: Wrong Answer

Solution code:
X=int(input())
setval=615

if X<setval:
    print('0')
else:
    if X%setval==0:
        print('1')
    else:
        print('0')

Submission status: Wrong Answer

Solution code:
a = input()
x = list(a)
if len(x) < 3:
  print(0)
else:
  max_num = int(x[0]) * (1 if len(x) == 3 else 10 ** int(len(x[1:])-2)) * 5
  if int(a[1:]) > max_num:
    print(0)
  else:
    print(1)

Submission status: Wrong Answer

Solution code:
a = input()
x = list(a)
if len(x) < 3:
  print(0)
else:
  max_num = int(x[0]) * (1 if len(x) <= 3 else 10 * int(len(x[1:])-2)) * 5
  if int(a[1:]) > max_num:
    print(0,max_num)
  else:
    print(1)

Submission status: Wrong Answer

Solution code:
a = input()
x = list(a)
if len(x) < 3:
  print(0)
else:
  max_num = int(x[0]) * (1 if len(x) <= 2 else 10 * int(len(x[1:])-2)) * 5
  if int(a[1:]) > max_num:
    print(0)
  else:
    print(1)

Submission status: Wrong Answer

Solution code:
def solve(N):
    
    l = 100; r = 105
    for i in range(500):
        if l <= N <= r:
            return 1
        l += 100
        r += 105
    return 0
N = int(input())
print(solve(N))

Submission status: Wrong Answer

Solution code:
N = int(input())
l = 100; r = 105
for i in range(5000):
    if l <= N <= r:
        print(1)
        break
    l += 100
    r += 105
print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = 100; r = 105
for i in range(500):
    if l <= N <= r:
        print(1)
        break
    l += 100
    r += 105
print(0)

Submission status: Wrong Answer

Solution code:
n=int(input())
q,r=divmod(n,100)
cnt=0
i=5
while cnt<=q:
	if r>=i:
		cnt+=1
		r-=i
	else:
		i=max(i-1,0)
print(1 if r==0 else 0)

Submission status: Wrong Answer

Solution code:
n=int(input())
q,r=divmod(n,100)
cnt=0
i=5
while cnt<=q:
	if r>=i:
		cnt+=1
		r-=i
	else:
		i-=1
print(1 if r==0 else 0)

Submission status: Wrong Answer

Solution code:
x=int(input())
n=int(x/100)
y=x-100*n
a=0
for a in range(n+1):
    for b in range(n+1-a):
        for c in range(n+1-a-b):
            for d in range(n+1-a-b-c):
                for e in range(n+1-a-b-c-d):
                    if 5*a+4*b+3*c+2*d+e==y:
                        print(1)
                        a+=1
                        break
                break
            break
        break

if a==1:
    print(0)