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:
#200以下で約数が8つの自然数は24, 30, 40, 42, 54, 56, 66, 70, 78, 88, 102, 104, 105, 110, 114, 128, 130, 135, 136, 138, 152, 154, 165, 170, 174, 182, 184, 186, 189, 190, 195
#うち奇数であるものは105,135,165,189,195
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:
cand = [105, 135, 165, 189, 195]
k = int(input())
print(len([n for n in cand if n <= k]))

Submission status: Accepted

Solution code:
def f(n):
  if n < 105:
    return 0
  if n % 2 == 0:
    return 0
  c = 0
  for i in range(1, n + 1):
    if n % i == 0:
      c += 1
  if c == 8:
    return 1
  else:
    return 0

print(sum(map(lambda x:f(x), [x for x in range(1, int(input()) + 1)])))

Submission status: Accepted

Solution code:

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

    if c == 8:
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
def solve():
    n = int(input())
    ans = 0
    for i in range(1, n + 1, 2):
        divider = 0
        for j in range(3, n // 3 + 1, 2):
            if i % j == 0:
                divider += 1
        if divider == 6:
            ans += 1
    print(ans)


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
n = int(input())

if n < 105:
	print(0)
elif n == 105 or n == 106:
	print(1)
else:
	if n % 2 == 0:
		length = int(n / 2) - 1
	else:
		length = int(n / 2)
	array = []
	answer = 1
	for i in range(53,length+1):
		number = i * 2 + 1
		for x in range(1,n+1):
			if number % x == 0:
				array.append(x)
		if len(array) == 8:
			answer += 1
		array.clear()
	print(answer)

Submission status: Accepted

Solution code:
def div(n):
  d=0
  for i in range(1, n+1):
    if n%i==0:
      d+=1
  return d

n=int(input())
ans=0
for i in range(1, n+1, 2):
  if div(i)==8:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
def main():
    N =  int(input())
    cnt = 0
    for i in range(3, N + 1, 2):
        div = 0
        for j in range(1,i+1):
            if i % j == 0:
                div += 1
        if div == 8:
            cnt += 1

    print(cnt)


main()

Submission status: Accepted

Solution code:
n = int(input())

cnt = 0
for i in range(1,n+1,2):
  yakusu = 0
  for j in range(1,i+1):
    if i%j == 0:
      yakusu += 1
  if yakusu == 8:
    cnt += 1
  
print(cnt)

Submission status: Accepted

Solution code:
import sys
from collections import deque

sys.setrecursionlimit(4100000)


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


def solve(inputs):
    N = int(inputs[0])
    count = 0
    for i in range(1, N + 1):
        divisor_num = 0
        if i % 2 == 0:
            continue
        for j in range(1, i + 1):
            if i % j == 0:
                divisor_num += 1
        if divisor_num == 8:
            count += 1
    return count


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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
import bisect
idx=bisect.bisect([105, 135, 165, 189, 195],n)
print(idx)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for i in range(1, n + 1, 2):
    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())
cnt_t = 0
for i in range(1, n + 1, 2):
    cnt = 0
    t = i
    for j in range(1, t + 1):
        if t % j == 0:
            cnt += 1
    if cnt == 8:
        cnt_t += 1
print(cnt_t)

Submission status: Accepted

Solution code:
#約数8個なので、8、2*4、2*2*2
#8の場合、最小の奇数は3^7で200より大きい
#2*4の場合、最小の奇数は3^3*5^1、次は3^3*7^1、それより大きい場合は200より大きくなる
#2*2*2の場合、最小の奇数は3^1*5^1*7^1、3^1*5^1*11^1,3^1*5^1*13^1それより大きい場合は200より大きくなる

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 math
import copy
import sys

inputa = input().split()
# inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputaList = [int(n) for n in inputa]

# inputb = input().split()
# inputbList = [int(n) for n in inputb]
#
# inputList = []
# inputNumList = []
# for i in range(a):
#     inputNum = input()
#     inputNumList = list(inputNum)
#     inputList.append(inputNumList)

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

anscnt = 0
for i in range(1, a+1, 2):
    cnt = 0

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

    if cnt == 8:
        anscnt += 1

print(int(anscnt))

Submission status: Accepted

Solution code:
n = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return len(divisors)

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,N+1,2):
    #約数の数が奇数かどうかを判定する
    sho = 0
    for j in range(1,i+1):
        if i % j == 0:
            sho += 1
    if sho == 8:
        counter += 1

print(counter)

Submission status: Accepted

Solution code:
N = int(input())

count = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1,n+1,2):
    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_divisors(n):
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != (n // i):
                divisors.append(n // i)
    return divisors

print(sum(1 for j in range(1, n + 1) if len(make_divisors(j)) == 8 and j % 2 == 1))

Submission status: Accepted

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

Submission status: Accepted

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
count = 0
for i in range(1, n+1):
    if i%3 ==0 and i%5 == 0 and i%7 ==0:
        count+=1
    
    elif i%27==0 and i%5==0:
        count+=1
    
    elif i%27==0 and i%7 ==0:
        count+=1
    elif i%3==0 and i%5==0 and i%13==0:
        count+=1
    elif i%3 ==0 and i%5==0 and i%11 ==0:
        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 != 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())
odds = [i*2+1 for i in range(100)]
cnt=0
for odd in odds:
  #if odd==105: print(odd)
  if odd>N:
    break
  temp_cnt=0
  for lil_odd in odds:
    #if odd==105: print("lil_odd :",lil_odd)
    if lil_odd>odd:
      if temp_cnt==8:
        cnt+=1
      break
    if odd%lil_odd==0:
      #if odd==105: print("True")
      temp_cnt+=1
  #if odd==105: print("temp_cnt :",temp_cnt)
print(cnt)

Submission status: Accepted

Solution code:
def resolve():
    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)
resolve()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
def count_yakusu(n):
    yakusu = []
    for i in range(1,n+1):
        if n%i == 0:
            yakusu.append(i)
    return len(yakusu)
#print(count_yakusu(105))
ans = 0
for i in range(1,N+1,2):
    #print(i)
    if count_yakusu(i) == 8:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from operator import itemgetter

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

def main():
	n = int(input().strip())
	ans = 0
	for i in range(1, n+1):
		if i % 2 == 1 and div_count(i) == 8:
			ans += 1
	print(ans)

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
N = int(input())

def primes(n):
    a = []
    for i in range(1, n+1):
        if n % i == 0:
            a.append(i)
    return a

k = 0
for i in range(N+1):
    if i % 2 == 1:
        if len(primes(i)) == 8:
            k += 1
print(k)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count_2)

Submission status: Accepted

Solution code:
N = int(input())
M = [105,135,165,189,195]
T = 0
for i in range(5):
  if N >= M[i]:
    T += 1
print(T)

Submission status: Accepted

Solution code:
def divisor(target):
    divNum = 0

    for i in range(1,target+1):
        if target%i == 0:
            divNum +=1
    
    return divNum

def main():

    N = int(input())
    ans = 0

    for i in range(1,N+1,2):
    
        if 8 == divisor(i):
            ans += 1
    print(ans)








    
if __name__== "__main__":
    main()

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 = 0
for i in range(n+1):
    count = 0
    for j in range(1,i+1):
        if i%j == 0:
            count+=1
    if count==8 and i%2 == 1:
        ans += 1
print(ans)

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())
ans = 0
for i in range(1,N+1):
    cnt = 1
    if i%2==1:
        for j in range(1,i//2 + 1):
            if i%j==0:
                cnt+=1
        if cnt==8:
            ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = int(input())

def FindAllDivisors(x):
    divList = []
    y = 1
    while y <= math.sqrt(x):
        if x % y == 0:
            divList.append(y)
            divList.append(int(x / y))
        y += 1
    return divList
ans = 0
if (N == 105):
  ans = 1
elif (N > 105):
  ans += 1
  for i in range(106, N+1):
    if (i % 2 != 0):
      lst = FindAllDivisors(i)
      if (len(lst) == 8):
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

a = np.zeros(201)

for d in range(1,201,2):
  a[d::2*d]+=1

a=(a==8).cumsum()

N = int(input())
print(a[N])

Submission status: Accepted

Solution code:
ans = [105,135,165,189]
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())
b=[]
a=[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199]
def f(x):
	b=[]
	y=x
	for i in range(len(a)):
		x=y
		cnt=0
		while cnt>=0:
			if x%a[i]==0:
				cnt+=1
				x=x//a[i]
			else:
				break
		b.append(cnt)
	ans=1
	for i in range(len(b)):
		ans*=b[i]+1
	return ans
ans=0
for j in range(1,n+1,2):
	if f(j)==8:
		ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors

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

print(cnt)

Submission status: Accepted

Solution code:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

N = int(input())
ans = 0

for i in range(1,N+1,2):
    if len(make_divisors(i)) == 8:
        # print(make_divisors(i))
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n=int(input());print((n>104)+(n>134)+(n>164)+(n>188)+(n>194))

Submission status: Accepted

Solution code:
from math import floor, sqrt
 
N = int(input())
ans = 0
for o in range(1, N + 1, 2):
    cnt = 0
    for n in range(1, 1 + floor(sqrt(o))):
    	if o % n == 0:
            cnt += 2
    if cnt == 8:
        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 = list(range(1,int(input())+1,2))
li = []
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
for i in range(len(n)):
    if len(make_divisors(n[i])) == 8:
        li.append(n[i])
print(len(li))

Submission status: Accepted

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

for i in range(1,n+1,2):
    cnt = 0
    for j in range(1,i+1):
        if i%j == 0:
            cnt += 1
    else:
        if cnt == 8:
            ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)

    # N の逆元
    # N_inv = pow(N,MOD-2,MOD)

    # nCr
    # Nの階乗 * rの階乗の逆元 * n-rの階乗の逆元
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")

    # 大きな素数
    MOD = 10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N = int(input())
    ans = 0
    for i in range(1,N+1,2):
        num_of_y = 0
        for j in range(1,N+1):
            if i % j == 0:
                num_of_y += 1
        if num_of_y == 8:
            ans += 1
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# ABC 106, B - 105
n = int(input())

total = 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:
            total += 1
print(total)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
add = [i for i in range(n+1) if i%2 ==1]
for i in add:
    num = 0
    for j in range(1,n+1):
        if i%j ==0:
            num += 1
    if num == 8:
        ans +=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
if 1<=n<=104:
    print(0)
elif n<=134:
    print(1)
elif n<=164:
    print(2)
elif n<=188:
    print(3)
elif n<=194:
    print(4)
else:print(5)

Submission status: Accepted

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

c = 0
n = int(input())

for i in range(1,n+1,2):
    if len(factor(i)) == 8:
        c += 1
print(c)

Submission status: Accepted

Solution code:
n = int(input())


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

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

print(divcnt)

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:
def divisors(n, sort=False):
    """
    nの約数をO(√n)で列挙する
    """
    d = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            d.append(i)
            if i != n // i:
                d.append(n//i)
    if sort:
        d.sort()
    return d


N = int(input())

cnt = 0
for i in range(1, N + 1, 2):
    if len(divisors(i)) == 8:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
def divisors(n, sort=False):
    """
    nの約数をO(√n)で列挙する
    """
    d = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            d.append(i)
            if i != n // i:
                d.append(n//i)
    if sort:
        d.sort()
    return d


N = int(input())

cnt = 0
for i in range(1, N + 1):
    if i % 2 == 0:
        continue
    if len(divisors(i)) == 8:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import collections
n=int(input())
cnt=0
tmp=[]
for i in range(1,n+1,2):
  for j in range(1,n+1):
    if i%j==0:
      tmp.append(i)
      
x=collections.Counter(tmp)
for j in x.values():
  if j==8:
    cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
def find(n):
    yakusu=[]
    for i in range(1,n+1):
        if n%i==0:
            if (n/i) in yakusu:
                break
            else:
                yakusu.append(i)
                yakusu.append(n/i)
    return len(yakusu)

n=int(input())
num=0
for i in range(1,n+1,+2):
    if find(i)==8:
        num+=1
print(num)

Submission status: Accepted

Solution code:


n = int(input())

def count(x):
    res = 0
    for i in range(1, x + 1):
        if x % i == 0:
            res += 1
    return res

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

print(res)

Submission status: Accepted

Solution code:
N = int(input())

cnt = 0
for i in range(1, N+1, 2):
    cntt = 0
    for j in range(1, i+1):
        if i % j == 0:
            cntt += 1
    if cntt == 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())
x=0
for i in range(1,n+1,2):
    y = 0
    for j in range(1,i+1):
        if (i % j) == 0:
            y += 1
    if y == 8:
        x += 1
print(x)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for i in range(1, n+1):
    count=0
    if i % 2 == 1:
        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())
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)
else:
  print(5)

Submission status: Accepted

Solution code:
N = int(input())
cnt=0
if N <105:
  cnt =0
else:
  if N%2==0:
    for i in range(105,N+1,2):
      temp=0
      for j in range(1,N+1,2):
        if i%j==0:
          temp+=1
      if temp==8:
        cnt+=1
  else:
    for i in range(105,N+1,2):
      temp=0
      for j in range(1,N+3,2):
        if i%j==0:
          temp+=1
      if temp==8:
        cnt+=1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

ans=0
for i in range(1,n+1):
    if i%2!=0:
        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())

if n < 105:
    print(0)
    exit()

ans = 0
for i in range(105, n + 1, 2):
    c = 0
    for j in range(3, n // 2):
        if i % j == 0:
            c += 1
    if c == 6:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def divisors(n):
    div = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            div.append(i)
            if i**2 != n:
                div.append(n//i)
    return div

n = int(input())

ans = 0

for i in range(n):
    if len(divisors(i+1))==8 and i%2==0:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
if n < 3*5*7:
    print("0")
elif n < 3*5*9:
    print("1")
elif n < 3*5*11:
    print("2")
elif n < 3*7*9:
    print("3")
elif n < 3*5*13:
    print("4")
else:
    print("5")

Submission status: Accepted

Solution code:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

N = int(input())

ans = 0
for i in range(1,N+1,2):
    if len(make_divisors(i)) == 8:
        ans += 1

print(ans)

Submission status: Accepted

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return len(divisors)

N = int(input())
ctr = 0

for i in range(1, N + 1, 2):
    if make_divisors(i) == 8:
        ctr += 1
print(ctr)

Submission status: Accepted

Solution code:
import math
from itertools import groupby 

n = int(input())

def primeFacterList(L):
    """
    L = [num]を素因数分解し、出現した素因数を(小さい順に)リストにして返す
    [2] -> [2]
    [12] -> [2, 6] -> [2, 2, 3]
    [30] -> [2, 15] -> [2, 3, 5]
    """
    num = L.pop()
    limit = int(math.sqrt(num))
    for i in range(2, limit + 1):
        if num % i == 0:
            L.append(i)
            L.append(num // i)
            return primeFacterList(L)
    else:
        L.append(num)
        return L


def calc_divisor(L):
    """
    L = [prime facter list]なる自然数の約数の個数を返す
    """
    divisor = 1
    for key, val in groupby(L):
        divisor *= (len(list(val)) + 1)
    return divisor


count = 0
for i in range(1, n+1):
    if i % 2 == 1 and calc_divisor(primeFacterList([i])) == 8:
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
ansCnt = 0
for i in range(1, N + 1, 2):
    tmpCnt = 0
    for j in range(1, N + 1):
        if i < j:
            break
        if i % j == 0:
            tmpCnt += 1
    if tmpCnt == 8:
        ansCnt += 1

print(ansCnt)

Submission status: Accepted

Solution code:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    # divisors.sort()
    return divisors


N = int(input())
ans = 0
for i in range(1, N + 1, 2):
    divisors = make_divisors(i)
    if len(divisors) == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

S = [3*5*7, 3*5*11, 3*5*13, 3**3*5, 3**3*7]

ans = 0
for s in S:
    if s <= N:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
a = int(input())
n = list(range(1,a+1))
n = n[0::2]
#print(n)
ans = 0
arr = []
x = 1
count = 0
for i in n:
  count = 0
  for x in range(1,a+1):
    if  i % x ==0:
      count +=1
      #continue
  arr.append(count)    
    
    
print(arr.count(8))

Submission status: Accepted

Solution code:
import sys

n = int(input())
coun = 0
def yaku(num):
    yakusuu_array = []
    for i in range(1,num+1):
        if num % i == 0:
            yakusuu_array.append(i)
    return len(yakusuu_array)

for i in range(1,n+1,2):
    p = yaku(i)
    if p == 8:
        coun += 1
print(coun)

Submission status: Accepted

Solution code:
n = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

res = 0
for i in range(1,n+1):
    if i%2 == 1:
        x = make_divisors(i)
        if len(x) == 8:
            res += 1
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors


ans = 0

for i in range(1, N+1):
    if i % 2 != 0:
        if len(make_divisors(i)) == 8:
            ans += 1
print(ans)