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

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    X = int(inputs[0])
    NUM = 1000000
    items = [100, 101, 102, 103, 104, 105]
    r = X

    not_fin = True

    while r >= 100:
        amari = r % 100
        if r == 0:
            return 1
        if amari == 0:
            return 1

        matubi = amari % 10
        if amari >= 5:
            r -= 105
        else:
            r -= items[matubi]
    return 0


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Wrong Answer

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

if N // 101 > N // 105:
    print(1)
elif N % 105 == 0:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
words = lambda t : list(map(t, input().split()))
n = int(input())
ans = False
if n >= 2000:
    ans = True
else:
    if n // 20 >= (n % 100):
        ans = True
if ans:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
X = int(input())
if X < 100:
    print(0)
    exit()
A = X % 100
cnt = 0
cnt += (A % 5)
cnt += (A % 4) 
cnt += (A % 3) 
cnt += (A % 2)
cnt += (A % 1) 

if cnt*100 <= X:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	X = inputInt()

	tmp = X % 100
	kai = X // 100

	tmptmp = tmp // 5

	if tmptmp <= kai:
		print(1)
	else:
		print(0)

	#print(tmp)
	#print(kai)



if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:


# m1, d1 = list(map(int, input().split()))
# m2, d2 = list(map(int, input().split()))
X = int(input())

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

hasu = int(str(X)[-2:])
# print(hasu)

div5 = hasu / 5
hasu -= 5*div5

div4 = hasu / 4
hasu -= 4*div4

div3 = hasu / 3
hasu -= 3*div3

div2 = hasu / 2
hasu -= 2*div2

div1 = hasu / 1
hasu -= 1*div1

# print((div5+div4+div3+div2+div1))
if 100*(div5+div4+div3+div2+div1) > X:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
X = int(input())
count = 0
while X > 100:
    X -= 100
    count += 1

if count * 5 >= X:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
l=math.ceil(x/105)
r=math.floor(x/100)
#print(l,r)
if l==r:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	X = inputInt()

	tmp = X % 100
	kai = X // 100

	tmptmp = tmp // 5

	if tmptmp < kai:
		print(1)
	else:
		print(0)

	#print(tmp)
	#print(kai)



if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
X=int(input())
if X>=2000:
  print(1)
else:
  for i in range(1,20):
    if 100*i<=X and X<=105*i:
      print(1)
      exit()
      
print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

n = int(input())
for i in range(1, 100001):
	if i*(615) == n:
		c = i
	elif i*615 > n:
		break
try:
	print(c)
except:
	print(0)

Submission status: Wrong Answer

Solution code:
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby

x = int(stdin.readline().rstrip())
num = x / 100
data = x % 100
if data > num * 5:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
x = int(input())
for oni in range(1001):
    cnt = oni * 100
    if cnt > x:
        break
    for sand in range(1001):
        cnt += sand * 101
        if cnt > x:
            break
        for cookie in range(1001):
            cnt += cookie * 102
            if cnt > x:
                break
            for cake in range(1001):
                cnt += cake * 103
                if cnt > x:
                    break
                for candy in range(1001):
                    cnt += candy *104
                    if cnt > x:
                        break
                    for pc in range(1001):
                        cnt += pc * 105
                        if cnt == x:
                            print(1)
                            exit()
                        elif cnt > x:
                            break
print(0)

Submission status: Wrong Answer

Solution code:
import sys
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
a = [100,101,102,103,104,105]
dp = [[False]*(N+1) for i in range(6+1)]
dp[0][0] = True

for i in range(1,6+1):
  for j in range(N+1):
    if 0 <= (j - a[i - 1]) < N+1:
      if dp[i - 1][j - a[i - 1]] == True:
        dp[i][j] = True
    if dp[i - 1][j] == True:
      dp[i][j] = True
print(int(dp[-1][-1]))

Submission status: Wrong Answer

Solution code:
X = int(input())

num = X // 100
#print((X % 100) // 5)
#print(num)
if num >= (X % 100) // 5:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
q, mod = divmod(X, 100)

if q == 0:
    print(0)
else:
    if q >= math.ceil(mod // 5):
        print(1)
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
list = [100,101,102,103,104,105]

def get_integral_value_combination(list, target):
    def a(idx, l, r, t):
        if t == sum(l): r.append(l)
        elif t < sum(l): return
        for u in range(idx, len(list)):
            a((u + 1), l + [list[u]], r, t)
        return r
    return a(0, [], [], target)

ans = get_integral_value_combination(list, int(input()))

if len(ans) != 0:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
X = int(input())
if X < 100:
    print(0)
    exit()
A = X % 100
cnt = 0
cnt += (A % 5)
cnt += (A % 4) 
cnt += (A % 3) 
cnt += (A % 2) 

if cnt*100 <= X:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

x = int(input())

two_bit = x%100
five = two_bit//5
two_bit-= 5*five
if two_bit==0:
    amari = 0
else:
    amari = 1
if (five+amari) < x//100:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
#a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a = []

for i in range(1, 16):
    a.append(i)

#print(a)

temp = x % 100

if temp in a or temp % 2 == 0 or temp % 3 == 0 or temp % 4 == 0 or temp % 5 == 0:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, 100001):
	if i*(615) <= n:
		c = i
	else:
		break
try:
	print(c)
except:
	print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

r = n%100
h = n-r

print((r<=(h*5))*1)

Submission status: Wrong Answer

Solution code:
import sys

X = int(input())
tmp1 = X // 100
tmp2 = X % 100
ans = 1
if tmp1 == 0:
    print(ans)
    sys.exit()

while True:
    if tmp1 == 0:
        break
    t1 = tmp2 // 5
    t2 = tmp2 % 5
    tmp1 -= t1
    if tmp1 < 0:
        ans = 0
        break

    if t2 == 0:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ansmin=(n//100)*100
ansmax=ansmin+(n//100)*5
while True:
    if n>ansmin and ansmax>n:
        print(1)
        break
    if n>ansmax:
        print(0)
        break
    ansmin-=100
    ansmax-=105

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
num = x // 100
amari = x % 100
# print(num,amari)
print(1 if math.ceil(amari/5) < num else 0)

Submission status: Wrong Answer

Solution code:

N= int(input())

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

#100以上の桁の計算
N_100 = int(N/100)
#下二桁の計算
N_XX = int((N%100)/5)
if N_100 > N_XX:
  print(1)
else:
  print(0)

Submission status: Wrong Answer

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

print(dp[N][A])

Submission status: Wrong Answer

Solution code:
X = int(input())

num = X // 100
#print((X % 100) // 5)
#print(num)
if num > (X % 100) // 5:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
c = [100, 101, 102, 103, 104, 105]
INF = float("inf")
 
dp = [INF]*(x+1)
dp[0] = 0
 
for i in range(len(c)):
    for j in range(x+1):
        if j - c[i] < 0:
            continue
        else:
            dp[j] = min(dp[j], dp[j - c[i]] + 1)
if x == INF:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


y = x % 100


if y <= int(5 * x / 100):
    print("1")
else:
    print("0")

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
x=int(input())

f=0
for i in range(1,21):
    for j in range(100*i,105*i+1):
        if x ==j:
            f=1
if f==1:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
ok = [False for _ in range(100001)]

ok[100] = True
ok[101] = True
ok[102] = True
ok[103] = True
ok[104] = True
ok[105] = True

for i in range(106, 100000):
    ok[i] = (
        ok[i-100] or ok[i-101]
        or ok[i - 102] or ok[i-103] or ok[i-104] or ok[i-105]
    )

print('1' if ok[x] else '0')

Submission status: Wrong Answer

Solution code:
import itertools
n = input()
if len(n) <= 2:
    print(0)
    exit()
n = int(str(n)[0:3])
#print(n)
k = int(str(n)[0])
l = int(str(n)[1:3])
#print(k,l)
if l < 5*k:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

if X < 100:
    print(0)

if b == 0:
    print(1)
    exit()

for n in [5,4,3,2,1,0]:
    if a == 0:
        print(0)
        exit()

    tmp = b // n
    
    b -= min(a, tmp)*n
    a -= min(a, tmp)

    if b == 0:
        print(1)
        exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
count = 0
while X > 100:
    X -= 100
    count += 1

if count * 5 > X:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
x -= min(x // 100, 5000000) * 100
x -= min(x // 5, 1000000) * 5
x -= min(x // 4, 1000000) * 4
x -= min(x // 3, 1000000) * 3
x -= min(x // 2, 1000000) * 2
x -= min(x // 1, 1000000) * 1
if x == 0:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())

a = x // 100
b = x // 101
c = x // 102
d = x // 103
e = x // 104
f = x // 105

for aa in range(a):
  for bb in range(b):
    for cc in range(c):
      for dd in range(d):
        for ee in range(e):
          for ff in range(f):
            total = aa * 100 + bb * 101 + cc * 102 + dd * 103 + ee * 104 + ff * 105
            if total == x:
              # print(aa, bb, cc, dd, ee, ff)
              print('1')
              exit(0)
print('0')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
x -= min(x // 100, 5000000) * 100
x -= min(x // 5, 1000000) * 5
x -= min(x // 4, 1000000) * 4
x -= min(x // 3, 1000000) * 3
x -= min(x // 2, 1000000) * 2
x -= min(x // 4, 1000000) * 1
if x == 0:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())

a = x%100
b = x//100

m = a//5 + 1

if b < m:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
x = int(input())
#a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a = []

for i in range(1, 16):
    a.append(i)

#print(a)

temp = x % 100

if temp in a:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
y = x % 100
z = x // 100
print(y, z)

if z * 5 >= y:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
x=int(input())
dp=[0]*(x+1)
dp[0]=1
for j in range(6):
    val=100+j
    dp2=dp[:]
    for i in range(len(dp)-1,0,-1):
        if i>=val:
            if dp2[i-val]:
                dp[i]=1

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

Submission status: Wrong Answer

Solution code:
x = int(input())

if ((x%100)+4)/5 > x/100:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
abcde1 = X // 102
abcde2 = abcde1 + 1
db = X % 2
f1 = (X - 102 * abcde1 - db) // 2 <= abcde1 - db
f2 = (102 * abcde2 - db - X) // 2 <= abcde2 - db
if f1 or f2:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

for y2 in range(0, 51):
    for y3 in range(0, 34):
        for y4 in range(0, 26):
            for y5 in range(0, 21):
                y1 = d100 - (y2 + y3 + y4 + y5)
                if y1 < 0:
                    continue

                if (1 * y1) + (2 * y2) + (3 * y3) + (4 * y4) + (5 * y5) == X:
                    print(1)
                    exit()

print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

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

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

Submission status: Wrong Answer

Solution code:
import sys
import itertools
sys.setrecursionlimit(10**9)
X = int(input())

ITEM = [100, 101, 102, 103, 104, 105]
for t in itertools.product((True,False),repeat=6):
    s = 0
    for a,b in zip(t, ITEM):
        s += a*b
    if s == X:
        print(1)
        exit()
    
print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    x = input()
    for i1 in xrange(0, x + 1, 100):
        s1 = i1
        for i2 in xrange(0, x - s1 + 1, 101):
            s2 = s1 + i2
            for i3 in xrange(0, x - s2 + 1, 102):
                s3 = s2 + i3
                for i4 in xrange(0, x - s3 + 1, 103):
                    s4 = s3 + i4
                    for i5 in xrange(0, x - s4 + 1, 104):
                        s5 = s4 + i5
                        if s5 % 105 == 0:
                            print 1
                            return
    print 0

main()

Submission status: Wrong Answer

Solution code:
X=int(input())

x=X%100
i=0

for i in range(5,0,-1):
    i+=x//i
    x=x%i
if X//100>i:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



def main():
    x = ii()
    kosuu = x//105 +1
    ma = 105*kosuu
    if (ma-x)/5 < kosuu:
        print(1)
    else:
        print(0)
        


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
import sys
sys.setrecursionlimit(2000)
dic = defaultdict(int)
X = int(input())
def check(n):
  if n==100 or n==101 or n==102 or n==103 or n==104 or n==105:
    return True
  elif n<100:
    return False
  elif dic[n]!=0:
    return dic[n]
  else:
    for i in range(100,106):
      if check(n-i):
        dic[n-i]=1
        return True
      else:
        dic[n-i]=-1
    return False
if check(X):
  print(1)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

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

Submission status: Wrong Answer

Solution code:
X=int(input())

a=X//100
b=X%100
c=b%10
b=b//10
d=c%5
c=c//5
if d>0:
  e=1
else:
  e=0

temp=2*b+c+d
if temp>a:
  print(0)
else:
  print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
dp = [1]+[0]*X
if X<100:
    print(0)
    exit()
for i in range(100,X+1):
    if 100 <= i <= 105:
        dp[i]=1
    elif sum(dp[i-105:i-100])>=1:
        dp[i]=1
if dp[X] == 1:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

a = int(input())

b = a % 100
c = a // 100
if a >= 100 and b < c * 5:
    print("1")
else:
    print("0")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X=int(input())
N=X//100
R=X%100
cnt=0
for i in range(5,0,-1):
    while R>i:
        R-=i
        cnt+=1
    if R==0:
        break
print("1" if cnt<=N else '0')

Submission status: Wrong Answer

Solution code:
a = int(input())

b = a % 100
c = a // 100
if b < c * 5:
    print("1")
else:
    print("0")

Submission status: Wrong Answer

Solution code:
m = int(input())
f = [0] * (m + 1)
f[0] = 1
for x in range(100, 106):
  for i in range(m, x - 1, -1):
    f[i] = max(f[i - x], f[i])
print(f[m])

Submission status: Wrong Answer

Solution code:
x = int(input())
x -= min(x // 105, 1000000) * 105
x -= min(x // 104, 1000000) * 104
x -= min(x // 103, 1000000) * 103
x -= min(x // 102, 1000000) * 102
x -= min(x // 101, 1000000) * 101
x -= min(x // 100, 1000000) * 100
if x == 0:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt = 0
while n > 100:
    n -= 100
    cnt += 1
    if n <= cnt * 5:
        print(1)
        exit()
print(0)

Submission status: Wrong Answer

Solution code:
x=int(input())
dp=[0]*(x+1)
dp[0]=1
for j in range(6):
    val=100+j
    for i in range(len(dp)-1,0,-1):
        if i>=val:
            dp[i]+=dp[i-val]
if dp[-1]:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

q = X // 100
r = X % 100

if q*6 < r:
    print(0)
else:
    print(1)

Submission status: Time Limit Exceeded

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

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

Solution code:
X = int(input())
for i1 in range(1000000):
  for i2 in range(1000000):
    for i3 in range(1000000):
      for i4 in range(1000000):
        for i5 in range(1000000):
          for i6 in range(1000000):
            if 100 * i1 + 101 * i2 + 102 * i3 + 103 * i4 + 104 * i5 + 105 * i6 == X:
              print("1")
            else:
              print("0")

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
for i1 in range(1000000):
  for i2 in range(1000000):
    for i3 in range(1000000):
      for i4 in range(1000000):
        for i5 in range(1000000):
          for i6 in range(1000000):
            if 100 * i1 + 101 * i2 + 102 * i3 + 103 * i4 + 104 * i5 + 105 * i6 == X:
              print("1")
            else:
              print("0")

Submission status: Time Limit Exceeded

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

x = int(input())

ok = False

def dfs(n, flg):
    global ok
    if flg:
        return 
    if n == x:
        ok = True
        return
    if n > x:
        ok = False
        return
    dfs(n+100, ok) 
    dfs(n+101, ok) 
    dfs(n+102, ok) 
    dfs(n+103, ok) 
    dfs(n+104, ok) 
    dfs(n+105, ok) 

dfs(0, False)
if ok: print(1)
else: print(0)

Submission status: Time Limit Exceeded

Solution code:
import itertools as it
N=int(input())
S=[0,1,2,3,4,5]
for k in range(N//100):
  for i in it.product(S,repeat=N//100):
    if sum(i)==N%100:
      print("1")
      exit()
print("0")

Submission status: Time Limit Exceeded

Solution code:
x = int(input())

h = x//100

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

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
from collections import deque
q = deque([0])

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

while q:
    cost = q.pop()

    if cost > x:
        continue
    elif any([(x-cost)%p == 0 for p in prices]):
        print(1)
        break

    for p in prices:
        q.append(cost+p)
else:
    print(0)

Submission status: Time Limit Exceeded

Solution code:
import sys, math
from collections import deque
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def f(x):
    if x < 0:
        return False
    if (x%100==0) or (x%101==0) or (x%102==0) \
            or (x%103==0) or (x%104==0) or (x%105==0):
        return True
    return f(x-100) or f(x-101) or f(x-102) \
            or f(x-103) or f(x-104) or f(x-105)

def main():
    X = ii()
    print(1 if f(X) else 0)


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
import sys, math
from collections import deque
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def f(x):
    if x < 0:
        return False
    if x in [100, 101, 102, 103, 104, 105]:
        return True
    return f(x-100) or f(x-101) or f(x-102) \
            or f(x-103) or f(x-104) or f(x-105)

def main():
    X = ii()
    print(1 if f(X) else 0)


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
ans = 0
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:
              ans += 1
if ans == 0:
  print(0)
else:
  print(1)

Submission status: Time Limit Exceeded

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

def solve(x):
    if x >= 2000:
        return True
    memo = [True] + [False]*x

    def dp(k):
        if k == 0:
            return True
        elif k < 0:
            return False
        elif memo[k]:
            return True
        for i in range(100,106):
            if dp(k-i):
                return True
        
        return False
    
    for i in range(x):
        memo[i+1] = dp(i+1)
    return memo[x]



def main():
    X = int(input())
    print(int(solve(X)))
    return

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

def solve(x):
    if x >= 2000:
        return True
    memo = [True] + [False]*x

    def dp(k):
        if k == 0:
            return True
        elif k < 0:
            return False
        elif memo[k]:
            return True
        for i in range(100,106):
            if dp(k-i):
                memo[k-i] = True
                return True
        
        return False

    return dp(x)



def main():
    X = int(input())
    print(int(solve(X)))
    return

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

def solve(x):
    if x >= 2000:
        return True
    def dp(x):
        if x == 0:
            return True
        elif x < 0:
            return False
        for i in range(100,106):
            if dp(x-i):
                return True
        
        return False

    return dp(x)



def main():
    X = int(input())
    print(int(solve(X)))
    return

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

import sys
sys.setrecursionlimit(10**9)

def solve(x):
    def dp(x):
        if x == 0:
            return True
        elif x < 0:
            return False
        for i in range(100,106):
            if dp(x-i):
                return True
        return False

    return dp(x)



def main():
    X = int(input())
    print(int(solve(X)))
    return

if __name__ == '__main__':
    main()