Problem:


Score: 200 points

Problem Statement

The number 105 is quite special - it is odd but still it has eight divisors.
Now, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?

Constraints

N is an integer between 1 and 200 (inclusive).

Input

Input is given from Standard Input in the following format:

N

Output

Print the count.

Sample Input 1

105

Sample Output 1

1

Among the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.

Sample Input 2

7

Sample Output 2

0

1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.



Sample input:
105


Sample output:
1

Submission status: Accepted

Solution code:
def num_of_divisors(x):
  num=0
  for divisor in range(1, x + 1):
    if x % divisor == 0: num += 1
  return num

N = int(input())
cnt = 0
for i in range(1, N + 1, 2):
  if num_of_divisors(i) == 8:
    cnt += 1

print(str(cnt))

Submission status: Accepted

Solution code:
n = int(input())
def cnt(x):
	return sum(1 for i in range(1, x+1) if x%i == 0)
print(sum(1 for i in range(1, n+1, 2) if cnt(i) == 8))

Submission status: Accepted

Solution code:
# coding:utf-8
list=[0]*1000
for i in range(1,201,1):
    m=1
    while m*i<=200:
        list[m*i]+=1
        m+=1
n=int(input())
ct=0
for i in range(1,n+1,2):
    if list[i]==8:
        ct+=1
print(ct)

Submission status: Accepted

Solution code:
n= int(input())
ans =0
for i in range((n+1)//2):
	count=1
	for j in range(i//2):
		if (2*i+1)%(2*j+1)==0:
			count += 1
		
	if count == 8:
		ans +=1
	
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

if n < 105:
    print(0)
elif n < 135:
    print(1)
elif n < 165:
    print(2)
elif n < 189:
    print(3)
elif n < 195:
    print(4)
elif n < 201:
    print(5)

Submission status: Accepted

Solution code:
n=int(input())

if n < 105:
    print(0)
elif n < 135:
    print(1)
elif n < 165:
    print(2)
elif n < 189:
    print(3)
elif n < 195:
    print(4)
else:
    print(5)

Submission status: Accepted

Solution code:
import numpy as np

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append(e)
        b, e = b + 1, 0
    if n > 1:
        fct.append(1)
    return np.asarray(fct)

last_val = int(raw_input().replace("\n", ""))
count = 1 if last_val >= 105 else 0
for val in xrange(107, last_val+1, 2):
    ret = factorize(val)
    yaku_num = np.prod(ret + 1)
    if yaku_num == 8:
        count += 1

print count

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1, n+1):
  cnt = 0
  if i%2==1:
    for j in range(1, i+1):
      if i%j==0:
        cnt+=1
      if j==i and cnt==8:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
print(sum([sum([i%j==0 for j in range(1,i+1)])==8 for i in range(1,int(input())+1,2)]))

Submission status: Accepted

Solution code:
n = int(input())
if n>=195:
    print(5)
elif n>=189:
    print(4)
elif n>=165:
    print(3)
elif n>=135:
    print(2)
elif n>=105:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
N = int(input())
prime =[3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53]
count = 0
for i in range(N):
    if i+1 >= 105 and (i+1) % 2 == 1:
        tmp = 0
        for j in range(i+1):
            if (i+1) % (j+1) == 0:
                tmp += 1
        if tmp == 8:
            count += 1
print(count)

Submission status: Accepted

Solution code:
#coding:utf-8
n=int(input())
count=0
ans=0
for i in range(1,n+1,2):
  for j in range(1,i+1,2):
    if(i%j==0):
      count+=1
  if(count==8):
    ans+=1
  count=0
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
res=0
for i in range(1,n+1,2):
    y=1
    for j in range(3,15):
        cnt=1
        while i%j==0:
            cnt+=1
            i//=j
        y*=cnt
    if y==8:
        res+=1
print(res)

Submission status: Accepted

Solution code:
N=int(raw_input())
d=0
for x in xrange(105,N+1):
    if(x%2==0): continue
    div=2
    i=2
    while i<=(x//2+x%2) and div<9:
        div=div+(0,1)[x%i==0]
        i=i+1
    #print(div,x)    
    if(div==8): d=d+1    
print("%d"%d)

Submission status: Accepted

Solution code:
a = int(input())
 
b=0#約数の個数
 
for num in range(1,a+1):#i:1~inputまで,奇数だけ
  if num % 2 == 1:
  #ある数Niについて約数を数える
    yakusuu = 0
    for i in range(1,num):
      if num % i == 0:
        yakusuu += 1
    if yakusuu == 7:
      b += 1
print(b)

Submission status: Accepted

Solution code:
N = int(input())+1
yakusuu = 0
for i in range(1,int((N-N%2)/2)+2):
    cnt = 0
    ii = 1+ 2*(i-2)
    for j in range(1,ii):
        if ii % j == 0:
            cnt = cnt+1
    cnt = cnt+1
    if cnt == 8:
        yakusuu = yakusuu + 1
print(yakusuu)

Submission status: Accepted

Solution code:
li = list(map(int,input().split()))
n=li[0]
ans = 0
for i in range(1,n+1):
    if i%2==0:
        continue
    count = 0
    for j in range(1,i+1):
        if i%j==0:
            count+=1
    if count == 8:
        #print(i)
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
 
if (0 <= N) and (N <105):
  print(0)
elif (105 <= N) and (N < 135):
  print(1)
elif (135 <= N) and (N < 165):
  print(2)
elif (165 <= N) and (N < 189):
  print(3)
elif (189 <= N) and (N < 195):
  print(4)
else:
  print(5)

Submission status: Accepted

Solution code:
n = int(input())

result = 0
for i in range(1, n+1, 2):
    count = 0
    for j in range(1, i+1):
        if i % j == 0:
            count += 1
    if count == 8:
        result += 1

print(result)

Submission status: Accepted

Solution code:
import math

n = int(input())

cnt = 0

def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num

for i in range(n+1):
    if i%2==1 and search_divisor_num_1(i) == 8:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import numpy as np

def Count(n,divisor):
    print (divisor <= n).sum()

EightDivisors = np.array([3*5*7, 3*5*11, 3*5*13, 3*7*11, 3**3 *5, 3**3 * 7, 3**3 * 11])


n = int(raw_input())
Count(n, EightDivisors)

Submission status: Accepted

Solution code:
N = int(input())
if N < 105:
  print('0')
elif N < 135:
  print('1')
elif N < 165:
  print('2')
elif N < 189:
  print('3')
elif N < 195:
  print('4')
else:
  print('5')

Submission status: Accepted

Solution code:
prime = [3,5,7,11,13,17,19,23]
ans = []
for item1 in prime:
  for item2 in prime:
    for item3 in prime:
      if item1 != item2 and item2 != item3 and item3 != item1:
        if item1*item2*item3 < 201:
          ans.append(item1*item2*item3)
for item1 in prime:
  for item2 in prime:
    if item1 != item2:
      if (item1**3)*item2 < 200:
        ans.append((item1**3)*item2)
ans = list(set(ans))
n = int(input())
print(len(list(filter(lambda x:x<=n ,ans))))

Submission status: Accepted

Solution code:
#coding: utf-8
import math

n = int(raw_input())
y_list = [[]]
cnt = 0
cnt_y = 0

for i in range(1,n+1,2):
    ri = (i>>1) 
    for j in range(3,ri,2):
        if i%j == 0: cnt_y += 1
    if cnt_y + 2 == 8: cnt += 1
    cnt_y = 0

print cnt

Submission status: Accepted

Solution code:
N = int(input())
if N <= 104:
    print(0)
else:
    ki = []
    for i in range(105, N + 1):
        if i % 2 == 1:
            ki.append(i)
    yakusuu = []
    for i in ki:
        count = 0
        for j in range(1, i + 1):
            if i % j == 0:
                count += 1
        if count == 8:
            yakusuu.append(i)
    print(len(yakusuu))

Submission status: Accepted

Solution code:
N = int(input())
countans = 1
if(N < 105):
  print(0)
elif(N < 107):
    print(1)
else:
    for i in range(107, N+1, 2):
        count = 1
        for j in range(1, int(N/2)):
            if(i%j == 0):
                count += 1
        if(count == 8):
            countans += 1
    print(countans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import math

def factoring(n):
    num = 0
    for i in range(1, n + 1):
        if n % i == 0:
            num += 1
    return num


N = int(input())
ans = 0
for i in range(1, N + 1, 2):
    if int(factoring(i)) == 8:
        ans += 1 

print(ans)

Submission status: Accepted

Solution code:
N = int( input() )
a = 0

for j in range(1,N+1):
  b = 0
  for i in range(1,j+1):
    if j % i == 0:
      b += 1
  if b == 8 and j % 2 == 1:
    a+=1
    
print(a)

Submission status: Accepted

Solution code:
def factorization(n):
    def factor_sub(n, m):
        c = 0
        while n % m == 0:
            c += 1
            n /= m
        return c, n
    #
    buff = []
    c, m = factor_sub(n, 2)
    if c > 0: buff.append((2, c))
    c, m = factor_sub(m, 3)
    if c > 0: buff.append((3, c))
    x = 5
    while m >= x * x:
        c, m = factor_sub(m, x)
        if c > 0: buff.append((x, c))
        if x % 6 == 5:
            x += 2
        else:
            x += 4
    if m > 1: buff.append((m, 1))
    return buff

def divisor_num(n):
    a = 1
    for _, x in factorization(n):
        a *= x + 1
    return a

n = int(input())

cnt = 0
for x in range(n + 1):
    if x % 2 == 1:
        if divisor_num(x) == 8:
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n=int(input())
if n<105:
    print(0)
elif n<135:
    print(1)
elif n<165:
    print(2)
elif n<189:
    print(3)
elif n<195:
    print(4)
else:
    print(5)

Submission status: Accepted

Solution code:
N = int(input())

Ans = 0

for i in range(1,N+1,2):
    count = 0
    for j in range(1,i,2):
        if i % j == 0:
            count += 1
    if count == 7:
        Ans += 1

print(Ans)

Submission status: Accepted

Solution code:
N=int(input())

ans=0
if N>=105:
    ans+=1
if N>=135:
    ans+=1 
if N>=165:
    ans+=1
if N>=189:
    ans+=1
if N>=195:
    ans+=1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(1, N+1, 2):
    count = 0
    for j in range(1, i+1):
        if i%j==0:
            count += 1
    if count == 8:
        ans += 1
        
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
ans=int(0)
if n>=105:
    ans+=1
if n>=135:
    ans+=1
if n>=165:
    ans+=1
if n>=189:
    ans+=1
if n>=195:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())+1
res=0
for i in range(1,n):
	if i%2==0:
		continue
	s=0
	for j in range(1,i+1):
		if i%j==0:
			s+=1
	if s==8:
		res+=1
print(res)

Submission status: Accepted

Solution code:
N = int(input())
c = 0
for i in range(1,N+1):
    r = []
    if i % 2 != 0:
        for j in range(1,i+1):
            if i % j == 0:
                r.append(j)
        if len(r) == 8:
            c+=1
print(c)

Submission status: Accepted

Solution code:
n = int(input())

if n < 105:
    print(0)
elif n < 135:
    print(1)
elif n < 165:
    print(2)
elif n < 189:
    print(3)
elif n < 195:
    print(4)
else:
    print(5)

Submission status: Accepted

Solution code:
N = int(input())

count = 0
total = 0

for j in range(1,N+1):
    count = 0
    if j % 2 != 0:
        for i in range(1,j+1):
            if j % i == 0:
                count += 1
    if count == 8:
        total += 1
print(total)

Submission status: Accepted

Solution code:
N = int(input())

counttmp = 0
count = 0
for i in range(1,N+1):
    counttmp = 0
    if i%2 == 1:
        for j in range(1,i+1):
            if i%j == 0:
                counttmp += 1
        if counttmp == 8:
            count += 1

print(count)

Submission status: Accepted

Solution code:
n = int(input())
count = 0
check = 0
for j in range(1, n+1):
    if j % 2 == 0:
        continue
    for i in range(1, j):
        if j % i == 0:
            check += 1
    if check == 7:
        # print(j)
        count += 1
    check = 0
print(count)

Submission status: Accepted

Solution code:
N = int(input())

x = [0]*(N+1)
for i in range(1,N+1):
    for j in range(1,N+1,2):
        if j % i == 0:
            x[j]+=1
ans = 0
for i in x:
    if i == 8:
        ans +=1
print(ans)

Submission status: Accepted

Solution code:
a=int(input());
r=0;
for i in range(1, a+1, 2):
    c=0;
    for j in range(2, i):
        if (i % j == 0):
            c+=1;
    if (c==6): r+=1;
print(str(r));

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0

for i in range(1, n + 1):
    count = 0
    if i % 2 != 0:
        for j in range(1, i + 1):
            if i % j == 0:
                count += 1

        if count == 8:
            cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8
#


def main(n):
    if n < 105:
        print(0)
        return
    so_list = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]
    chi_list = [0 for _ in range(len(so_list))]
    retval = 0
    for a in range(105,n + 1):
        t = a
        # 偶数を弾く
        if 0 == t%2:
            continue
        t_count = 0
        for s in range(len(so_list)):
            so = so_list[s]
            ## 最初だけ通る
            if 0 == t%so:
                #print(9)
                t_count += 1
            
            while 0 == t%so:
                #print(10)
                t /= so
                # chi_list[s] += 1
                t_count += 1
            if t == 1:
                if t_count == (8 - 2):
                    retval += 1
                break
    print(int(retval))
            
    
if __name__ == '__main__':
    try:
        n = int(input().strip())
        main(n)
    except EOFError:
        pass

Submission status: Accepted

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

def main():
    n = int(sys.stdin.readline().rstrip())
    if n < 105:
        print(0)
    else:
        z = [(i, 1) for i in range(107,n+1, 2)]
        for i in range(3, n+1, 2):
            z = list(map(lambda x: (x[0], x[1]+1) if x[0]%i==0 else x, z))
        c = len(list(filter(lambda x: x[1]==8, z)))
        print(c+1)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

if n < 105:
    ans = 0
elif n < 135:
    ans = 1
elif n < 165:
    ans = 2
elif n < 189:
    ans = 3
elif n < 195:
    ans = 4
else:
    ans = 5

print(ans)

Submission status: Accepted

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

def main():
    a = int(input())
    minNum = 3 * 5 * 7
    if a < minNum:
        print(0)
        return
    elif a <= minNum + 1:
        print(1)
        return

    count = 1
    if a % 2 == 1:
        a = a + 1
    for n in range(minNum + 2, a, 2):
        if countDevisor(n) == 8:
            count = count + 1

    print(count)


def factorize(num):
    facts = []
    n = num
    base, expo = 2, 0
    while base * base <= n:
        while n % base == 0:
            n = n // base
            expo = expo + 1
        if expo > 0:
            facts.append((base, expo))
        base = base + 1
        expo = 0

    if n > 1:
        facts.append((n, 1))

    return facts


def countDevisor(num):
    facts = factorize(num)
    count = 1
    for _, expo in facts:
        count = count * (expo + 1)
    return count


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def prime_t(t):
    i=2
    while i**2<=t:
        if t%i==0:
            return 0
        i+=1
    return 1

def prime_list(tt):
    p_list=[]
    for i in range(2,tt+1):
        if prime_t(i):
            p_list.append(i)
    return p_list

l=prime_list(201)

d={}

n=int(input())
chk=tmp=1
ans=0

for p in range(3,n+1,2):
    for i in l:
        chk=1
        while p%i==0:
            p//=i
            chk+=1
        tmp*=chk
    if tmp==8:
        ans+=1
    tmp=1
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
if N < 105:
    print(0)
elif 105 <= N and N < 135:
    print(1)
elif 135 <= N and N < 165:
    print(2)
elif 165 <= N and N < 189:
    print(3)
elif 189 <= N and N < 195:
    print(4)
elif 195 <=N :
    print(5)

Submission status: Accepted

Solution code:
n = int(input())
arr = [105, 135, 165, 189, 195]
print(sum([1 for x in arr if n >= x]))

Submission status: Accepted

Solution code:
def main():
    n = int(input().strip())

    cnt = 0
    for i in range(1, n+1, 2):
        m = i
        li = []
        for j in range(1, n+1, 2):
            if m % j == 0:
                li.append(j)

        if len(li) == 8:
            cnt += 1

    print(cnt)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# 105 = 3 * 5 * 7
# 1, 3, 5, 7, 15, 21, 35, 105
# 3 つの 素数を1回ずつ掛けてできる数(素因数が3つ)
# 3, 5, 7, 11, 13, 17
# 5 * 3 * 3 * 3 = 135
# 3 * 5 * 11 = 165
# 7 * 3 * 3 * 3 = 189
# 3 * 5 * 13 = 195

# 105以下では1つ(105のみ)なら, 200以下の整数なら, そういう奇数は105のみ?

prime = [3, 5, 11, 13, 17]

N = int(input())

if N >= 195:
    print(5)
elif N >= 189:
    print(4)
elif N >= 165:
    print(3)
elif N >= 135:
    print(2)
elif N >= 105:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
c = 0
for i in range(1,N+1,2):
    t = 0
    for j in range(1,i+1):
        if i%j == 0:
            t += 1
    if t >= 8:
        c += 1
print(c)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(1, N+1):
    cnt = 0
    for j in range(1, i + 1):
        if (i % j == 0):
            cnt += 1
    if (cnt == 8 and ((i % 2) == 1)):
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
if n < 105:
    print("0")
elif n < 135:
    print("1")
elif n < 165:
    print("2")
elif n < 189:
    print("3")
elif n < 195:
    print("4")
else:
    print("5")

Submission status: Accepted

Solution code:
li=int(input())

if li<105:
    print(0)
elif li< 135:
    print(1)
elif li< 165:
    print(2)
elif li< 189:
    print(3)
elif li< 195:
    print(4)
else:
    print(5)

Submission status: Accepted

Solution code:
def divisors(n):
    l = []
    for i in range(1, n+1):
        if n % i == 0:
            l.append(i)
    return l


n = int(input())
cnt = 0
for n in range(1, n+1, 2):
    d = divisors(n)
    if len(d) == 8:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
A=int(input())
ans = 0
for i in range(1,A+1):
    if i % 2 == 1:
        cnt = 0
        for j in range(1,i+1):
            if i % j == 0:
                cnt+=1
        if cnt == 8:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]
import math
def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num
count = 0
for i in range(1,n+1):
    if (search_divisor_num_1(i) == 8) and (i % 2 != 0):
        count += 1
print(count)

Submission status: Accepted

Solution code:
n=int(input())

if n<=104:
    print(0)
elif n>=105 and n<=134:
    print(1)
elif n>=135 and n<=164:
    print(2)
elif n>=165 and n<=188:
    print(3)
elif n>=189 and n<=194:
    print(4)
elif n>=195:
    print(5)

Submission status: Accepted

Solution code:
N = int(input())

if N >= 195:
    print("5")
elif N >= 189:
    print("4")
elif N >= 165:
    print("3")
elif N >= 135:
    print("2")
elif N >= 105:
    print("1")
else:
    print("0")

Submission status: Accepted

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


def count_divisor(num):
    c = 0
    for i in range(1, num + 1):
        if num % i == 0:
            c += 1
    return c


n = int(input().strip())

count = 0
for i in range(1, n + 1, 2):
    if count_divisor(i) == 8:
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
if N < 105:
  print(0)
elif N < 135:
  print(1)
elif N < 165:
  print(2)
elif N < 189:
  print(3)
elif N < 195:
  print(4)
else:
  print(5)

Submission status: Accepted

Solution code:
import numpy as np


def factor_num(N):
    factor = {}
    for i in range(2, int(N)):
        while N % i == 0:
            N /= i
            factor[i] = factor.get(i, 0) + 1

    return np.prod(list(map(lambda x: x+1, factor.values())))


N = int(input())
cnt = 0
for i in range(1, N+1):
    if i % 2 == 1 and factor_num(i) == 8:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())

k = [i for i in range(1, n + 1) if i % 2 == 1]

res = 0

for i in k:
    cnt = 0
    for j in range(1, i + 1):
        if i % j == 0:
            cnt += 1
            
    if cnt == 8:
        res += 1

print(res)

Submission status: Accepted

Solution code:
n = int(input())
ans = []
# 1-200までの全奇数の約数を求める
for i in range(1, 200, 2):
    cnt = 0
    for j in range(1, i + 1):
        if i % j == 0:
            cnt += 1

        # 約数の数が0個の奇数を配列にいれる。
        if cnt == 8:
            ans.append(i)

# N以下の配列の数を求める。
ans2 = []
for k in ans:
    if k <= n:
        ans2.append(k)

print(len(ans2))

Submission status: Accepted

Solution code:
n = int(input())
ans_list = []
for i in range(1, n + 1):
    if i % 2 == 1:
        count = 0
        for j in range(1, i + 1):
            if i % j == 0:
                count += 1
        if count == 8:
            ans_list.append(i)
    else:
        continue
print(len(ans_list))

Submission status: Accepted

Solution code:
N = int(input())
if N < 105:
    S = 0
elif N < 135:
    S = 1
elif N < 165:
    S = 2
elif N < 189:
    S = 3
elif N < 195:
    S= 4
else:
    S = 5
print(S)

Submission status: Accepted

Solution code:
N = int(input())

if N >= 195:
    print(5)
elif N >= 189:
    print(4)
elif N >= 165:
    print(3)
elif N >= 135:
    print(2)
elif N >= 105:
    print(1)
else:
    print(0)

Submission status: Accepted

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

n = int(input().strip())

def enum(i):
    result = []
    j = 1
    while j**2 <= i:
        if i % j == 0:
            result.append(j)
            #print("j: {}".format(j))
            #if j != 1 and j**2 != i:
            if j**2 != i:
                result.append(n/j)
                #print("n/j: {}".format(n/j))
        j += 1
    return result

num = 0
for i in [i for i in range(1,n+1) if i %2 ==1]:
    result = enum(i)
    if len(result) == 8:
        num += 1
print(num)

Submission status: Accepted

Solution code:
from collections import defaultdict
def f(n):
  dd=defaultdict(int)
  c=[2,3,5,7,11,13,17,19,23,29,31]
  i=0
  while i<11 and n//c[i]:
    while i<11 and n%c[i]==0:
      dd[c[i]]+=1
      n=n//c[i]
    i+=1
  r=1
  for i in dd.values():
    r*=(i+1)
  return r

n=int(input())

l=[i for i in range(1,n+1,2)]
print(sum([1 for i in l if f(i)==8]))

Submission status: Accepted

Solution code:
n = int(input())
rst = 0
for i in range(1, n + 1) :
    if i % 2 == 0 : continue
    count = 0
    for k in range(1 , i + 1) : 
        if i % k == 0 : count += 1
    if count == 8 : 
        rst += 1
    
print(rst)

Submission status: Accepted

Solution code:
n = int(input())
print(len([a for a in range(1,n+1) if a in [105,135,165,195,189]]))

Submission status: Accepted

Solution code:
def ans():
  n = int(input())
  ans = 0
  for i in range(1,n+1):
    count = 0
    for j in range(1,i+1):
      if i % j == 0:
        count += 1
      if count == 8 and i % 2 != 0:
        ans += 1
  print(ans)
  return

ans()

Submission status: Accepted

Solution code:
import sys

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    count = 0
    for i in range(1, N+1, 2):
        yakusu_count = 0
        for j in range(1, i+1):
            if i % j == 0:
                yakusu_count += 1
        if yakusu_count == 8 :
            count += 1
    print count


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
ip = input()
inputNum = int(ip)
totalCount = 0
for i in range(1,inputNum + 1):
    count = 0
    if i % 2 == 1:
        for j in range(1,i+1):
            if i % j == 0:
                count = count + 1
        if count == 8:
                totalCount = totalCount + 1

print(totalCount)

Submission status: Accepted

Solution code:
inp = input()
n = int(inp)

if  n < 105:
  print(0)
elif 105 <= n <135:
  print(1)
elif 135 <= n <165:
  print(2)
elif 165 <= n <189:
  print(3)
elif 189 <= n <195:
  print(4)
elif 195 <= n:
  print(5)

Submission status: Accepted

Solution code:
n = int(input())
a = 0
i = 1
while i <= n:
    c = 0
    j = 1
    while j <= i:
        if i % j == 0:
            c += 1
        j += 1
    if c == 8:
        a += 1
    i += 2
print(a)

Submission status: Accepted

Solution code:
n = int(input())
if n <= 104:
    ans = 0
elif n >= 105 and n < 135:
    ans = 1
elif n >= 135 and n < 165:
    ans = 2
elif n >= 165 and n < 189:
    ans = 3
elif n >= 189 and n < 195:
    ans = 4
elif n >= 195:
    ans = 5
print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())

def make_prime_list(num):
    if num < 2:
        return []

    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

def search_divisor_num(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num


print(int(list(map(search_divisor_num,list(range(1,N + 1))[:: 2])).count(8)))

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for i in range(1, N + 1, 2):
    num = 0
    for d in range(1, i + 1):
        if i % d == 0:
            num += 1
    if num == 8:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

n = int(input())

ans = 0
for n in range(n+1):
    if len([i for i in range(1,n+1) if n%i==0 and i%2!=0]) >= 8:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

if n < 105:
    print(0)
elif n < 135:
    print(1)
elif n < 165:
    print(2)
elif n < 189:
    print(3)
elif n < 195:
    print(4)
else:
    print(5)

Submission status: Accepted

Solution code:
N, = list(map(int,input().split()))

ans = 0

for i in range(N+1):
    if  i % 2 == 1:
        num = 0
        for j in range(1,201):
            if  i % j == 0:
                num += 1
                if  num == 8:
                    ans += 1
        
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

def isYakusuEight(a):
    if a % 2 == 0:
        return False
    cnt = 0
    for i in range(1, a+1):
        if a % i == 0:
            cnt += 1
    return cnt == 8

ans = 0
for i in range(1, N+1):
    if isYakusuEight(i):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
A=int(input())
count=0
for i in range(int((A+1)/2)):
    B=i*2+1
    div=[]
    for j in range(1,B):
        if B%j==0:
            div.append(j)
        else:
            pass
    else:
        div.append(B)
    if len(div)==8:
        count+=1
    else:
        pass
else:
    print(count)

Submission status: Accepted

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

if n < 105:
    print(0)
elif n < 135:
    print(1)
elif n < 165:
    print(2)
elif n < 189:
    print(3)
elif n < 195:
    print(4)
else:
    print(5)

Submission status: Accepted

Solution code:
N = int(input())
count = 0
for j in range(N+1):
  sum = 0
  for i in range(1,200,2):
    if j%i == 0:
      sum = sum+1
  if sum == 8:
    count = count+1
print(count)

Submission status: Accepted

Solution code:
A = int(input())
import numpy as np
L = np.arange(1,A+1,2)
count = 0 
countA = 0
for i in L:
    count=0
    for t in range(i):
        count+=1 if i%t==0 else 0
    countA += 1 if count == 8 else 0
print(countA)

Submission status: Accepted

Solution code:
n=input()
print sum(1 for k in range(1,n+1,2) if sum(1 for v in range(1,k+1) if k%v==0)==8)

Submission status: Accepted

Solution code:
N = int(input().strip())

c = 0
for n in range(1, N+1, 2):
  d = 0
  for i in range(1, n+1):
    if i * i > n:
      break
    if n % i == 0:
      d += 2
      if d >= 9:
        break
  if d == 8:
    c += 1

print(c)

Submission status: Accepted

Solution code:
n = int(input())
lst = [105, 135, 165, 189, 195, 201]
for i in range(6):
    if n < lst[i]:
        print(i)
        break

Submission status: Accepted

Solution code:
N=int(input())

list = [105,135,165,189,195]
ans = 0
for i in list:
    if i<=N:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ret = 0
for x in range(1, N + 1, 2):
    count = 0;
    for y in range(1,  x + 1):
        count += 1 if (x % y) == 0 else 0
    if (count == 8):
        ret += 1
print(ret)

Submission status: Accepted

Solution code:
n = int(input())

if n >= 195:
    print(5)
elif n >= 189:
    print(4)
elif n >= 165:
    print(3)
elif n >= 135:
    print(2)
elif n >= 105:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
n = int(input())
if n < 105:
    print(0)
elif 105 <= n < 135:
    print(1)
elif 135 <= n < 165:
    print(2)
elif 165 <= n < 189:
    print(3)
elif 189 <= n < 195:
    print(4)
elif 195 <= n:
    print(5)