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:
def c():
	X = int(input())
	bitset = 1
	for i in [100,101,102,103,104,105]:
		bitset |= (bitset << i)
	print(int((bitset & (1 << X)) != 0))
c()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=int(input())
print(int((s%100+1)//5*100<=s))

Submission status: Wrong Answer

Solution code:
import sys

x = int(input())

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

for i in range(0,19):
    if 100*i <= x <= 105*i:
        break

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

print(0)

Submission status: Wrong Answer

Solution code:
import math

x = int(input().strip())

sho = x//100
hasuu = x - 100*sho

if math.ceil(hasuu / 5) <= sho and math.ceil(hasuu / 1) >= sho:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
def count(S, m, n): 
    if n < 100:
        return False

    table = [False for k in range(n+1)]   
    table[100:106] = [True] * 6

    for i in range(106, n+1):
        table[i] = any([table[i-j] for j in range(S[0], S[-1]+1)])
  
    return 1 if table[n] else 0
  
def main():
    X = int(input())
    S = [100, 101, 102, 103, 104, 105] 
    print(count(S, len(S), X))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def count(S, m, n): 
    if n < 100:
        return True
    else:
        table = [False for k in range(n+1)] 
        table[:100] = [True] * 100
  
    table[100:106] = [False] * 6

    for i in range(106, n+1):
        table[i] = all([table[i-j] for j in range(S[0], S[-1]+1)])
  
    return table[n] 
  
def main():
    X = int(input())
    S = [100, 101, 102, 103, 104, 105, 106] 

    if count(S, 7, X):
        print(0)
    else:
        print(1)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
boo=[0 for i in range(10**5+1000)]
boo[100]=1
boo[101]=1
boo[102]=1
boo[103]=1
boo[104]=1
for i in range(100,n+1):
  if boo[i]==1:
    for j in range(6):
      boo[i+100+j]=1
if boo[n]:
  print(1)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
import sys
X=int(input())
Max_product_num=int(X//105)

for c in range(Max_product_num+1):
    if 100*c<=X or 105>X:
        print(1)
        sys.exit()
print(0)

Submission status: Wrong Answer

Solution code:
import itertools

n = int(input())

max = n // 100

result = 0

for a in range(0,max+1):
    for b in range(0,max+1):
        for c in range(0,max+1):
            for d in range(0,max+1):
                for e in range(0,max+1):
                    for f in range(0,max+1):
                        tmp = (105 * a) + (104 * b) + (103 * c) + (102 * d) + (101 * e) + (100 * f)
                        if tmp == n:
                            result = 1
                            break
                        elif tmp > n:
                            break
                    if tmp > n: break
                if tmp > n: break
            if tmp > n: break
        if tmp > n: break
    if tmp > n: break

Submission status: Wrong Answer

Solution code:
x = int(input())

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

def dfs(i, sum):
    if(i == 6):
        if(sum != 0):
            return True if x % sum == 0 else False
        else:
            return sum == x
    
    if (dfs(i + 1, sum)):
        return True

    if(dfs(i+1, sum + a[i])):
        return True

    return False

if(dfs(0,0)):
    print('1')
    exit()
print('0')

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = "0"
while True:
  if X >= 100:
    if 100 <= X <= 105:
      ans = "1"
      break
    else:
      X -= 105
  else:
    break
    
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

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

def dfs(i, sum):
    if(i == 6):
        if(sum != 0):
            return True if x % sum  == 0 else False
        else:
            return sum == x
    
    if (dfs(i + 1, sum)):
        return True

    if(dfs(i+1, sum + a[i])):
        return True

    return False

if(dfs(0,0)):
    print('1')
    exit()
print('0')

Submission status: Wrong Answer

Solution code:
def count(S, m, n): 
    table = [0 for k in range(n+1)] 
  
    table[0] = 0
    if n <= 100:
        return False
    if n <= 105:
        return True

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

    for i in range(0,m): 
        for j in range(S[i],n+1): 
            table[j] += table[j-S[i]] 
  
    return table[n] 
  
def main():
    X = int(input())
    S = [100, 101, 102, 103, 104, 105, 106] 

    if count(S, 7, X):
        print(1)
    else:
        print(0)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import itertools

n = int(input())

max = n // 100

result = 0

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

print(result)

Submission status: Wrong Answer

Solution code:
def check(x, num):
  if x == 0:
    return 1
  elif x < 100:
    return 0
  
  if(x>=100):
    return check(x-num,100)
  if(x>=101):
    return check(x-num,101)
  if(x>=102):
    return check(x-num,102)
  if(x>=103):
    return check(x-num,103)
  if(x>=104):
    return check(x-num,104)
  if(x>=105):
    return check(x-num,105)
  return 0
###########
X = int(input())

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

Submission status: Wrong Answer

Solution code:
import itertools

n = int(input())

max = n // 100

result = 0

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

print(result)

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=0
if x>=2000:
    print(1)
else:
    for a in range(20):
        for b in range(20):
            for c in range(20):
                for d in range(20):
                    for e in range(20):
                        for f in range(20):
                            if 100*a+101*b+102*c+103*d+104*e+105*f==x:
                                ans=1
print(ans)