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:
n = int(input())
odds = [i for i in range(1, n+1, 2)]
ans = 0
for odd in odds:
    c = 1
    for i in range(2, odd+1):
        if odd % i == 0:
            c += 1
    if c == 8:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
import sys
import itertools
import math
from collections import deque
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()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
def make_divisors(n):
    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
cnt = 0
for i in range(1,n+1):
    divisors = []
    if i%2 == 1:
        make_divisors(i)
        if len(divisors) == 8:
            cnt+=1
print(cnt)

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())
ans=0

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 len(divisors)

for i in range(1,n+1,2):
    if 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,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 cnt_div(n):
    cnt = 0
    for i in range(1,n+1):
        if i*i>n:break
        if n%i==0:
            cnt+=1
            if n//i!=i:
                cnt+=1
    return cnt
cnt = 0
for i in range(1,N+1):
    if i%2==1 and cnt_div(i)==8:
        cnt+=1
print(cnt)

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 = count + 1
  if count == 8:
    ans = ans + 1 
print(ans)

Submission status: Accepted

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

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):
		cnt += (i%j==0)
	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]:
    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:
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:
l = [3*5*7, 3*5*11, 3*5*13, 3**3*5, 3**3*7]

n = int(input())
ans = 0
for i in l:
    if i <= n:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
l = [3*5*7, 3*5*11, 3*5*13, 3**3*5, 3**3*7]

n = int(input())
ans = 0
for i in l:
    if i <= n:
        ans += 1
print(ans)

Submission status: Accepted

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

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 cnt==8:
      ans+=1

print(ans)

Submission status: Accepted

Solution code:
def odd_number_has_eigith_divisors(odd_number):
    divisor_number = 0
    for n in range(1, odd_number+1):
        divisor = 0
        if n % 2 == 0:
            pass
        else:
            for i in range(1, n+1):
                if n % i == 0:
                    divisor += 1
            if divisor == 8:
                divisor_number += 1

    return divisor_number


if __name__ == '__main__':
    input_num = int(input())
    print(odd_number_has_eigith_divisors(input_num))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N=int(input())
res=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):
        res+=1
print(res)

Submission status: Accepted

Solution code:
N = int(input())
table = [-1] + [1] * N
for i in range(3, N+1):
  for j in range(i, N+1, i):
    table[j] += 1
print(sum([True for i, _ in enumerate(table) if i % 2 and _ == 8]))

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())
sum=0
for i in range(n+1):
    if i%2!=0:
        if len(make_divisors(i))==8:
            sum+=1
print(sum)

Submission status: Accepted

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

N = int(input().strip())
#-----

if N <= 104:
    print(0)
    sys.exit()
elif N == 105:
    print(1)
    sys.exit()
else:
    ans_list=[105]
    for i in range(107,N+1,2):
        cnt=0
        for j in range(1,N+1):
            if i % j == 0:
                cnt += 1
        
        if cnt == 8:
            ans_list.append(i)

print(len(ans_list))

Submission status: Accepted

Solution code:
n=int(input())
import math
ans=0
def yakusu(n):
  ans_local=set()
  for i in range(1,int(math.sqrt(n))+1):
    if n%i==0:
      ans_local = ans_local | set([i,n//i]) #setなので平方数でもOK
  return list(ans_local)  #必要に応じてsort
for i in range(1,n+1,2):
    if len(yakusu(i))==8:
        ans+=1
print(ans)

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 len(divisors)

n=int(input())
ans=0

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

print(ans)

Submission status: Accepted

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

N = int(input())
ans = 0

def count_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 len(divisors)

for i in range(1, N+1):
    if i % 2 == 0:
        continue
    if count_divisors(i) == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
def is_ans(n:int) -> int:
    count = 0
    for i in range(1,n+1):
        if n%i == 0:
            count += 1
    return count

def main():
    tmp = 0
    ans = 0
    n = int(input())
    for i in range(1,n+1):
        if i%2 == 1:
            tmp = is_ans(i)
        if tmp == 8:
            ans += 1
        tmp = 0
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

N = int(input().split()[0])
total = 0
for i in range(1, N + 1):  # max = 200
    a = i
    if a % 2 == 0:
        continue
    c = 0
    for j in range(1, N + 1):  # max = 200
        if a % j == 0:
            c += 1
    if c == 8:
        total += 1
ans = total
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
cnt = 0
for i in range(n):
  if (i+1) % 2 == 1:
    if len(make_divisors(i+1)) == 8:
      cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
def main(n):
    ans = 0

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

        l = 0
        for j in range(1, i + 1):

            if i % j == 0:
                l += 1

        if l == 8:
            ans += 1

    print(ans)


if __name__ == "__main__":
    n = int(input())

    main(n)

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())

count=0
mitasuN=[]
for i in range(1,N+1,2):
    tmp_s = make_divisors(i)
    # print(tmp_s)
    if len(tmp_s)==8:
        count+=1
        mitasuN.append(i)
# print(mitasuN)
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def yakusu(num):
    x=num
    count=0
    i=0
    while (i<num):
        i+=1
        if (num%i==0):
            num=num/i
            count+=2
            if (num**2==x):
                count-=1
    return count

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

Submission status: Accepted

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

print(ans)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
n = []
R = []
for i in range(N+1):
    if i % 2 != 0 and i != 1:
        n.append(i)
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

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

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

    return arr
for x in n:
    a = factorization(x)
    b = []
    for y in range(len(a)):
        b.append(a[y][1] + 1)
    import functools
    import operator
    result = functools.reduce(operator.mul, b)
    if result == 8:
        R.append(x)
print(len(R))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    ans=0
    for j in range(1,N+1,2):
        tmp=0
        for i in range(1,j+1):
            if j%i==0:
                tmp+=1
        if tmp==8:
            ans+=1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

    divisor_count = 0
    for j in range(2, i // 2):
        if i % j == 0:
            divisor_count += 1
    if divisor_count == 6:
        count += 1

print(count)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1,n+1,2):
    tmp = 0
    for j in range(1,i+1):
        if i%j ==0:
            tmp +=1
    if tmp == 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 = 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(raw_input())
ans = 0
for i in range(1, N+1):
    num = 0
    if i%2 != 0:
        for j in range(1, N+1):
            if i%j == 0:
                num = num + 1
#        print i, num                                                                                  
        if num == 8:
            ans = ans + 1

print ans

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1,n + 1):
  if i % 2 == 0:
    continue
  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 yakusu(n):
    y=set([n])
    for i in range(1, int(n//2)+1):
        if n%i==0:
            y.add(i)
    return len(y)
ans=0
for i in range(1,N+1,2):
    if yakusu(i)==8:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    f = [0]*(n+1)
    for i in range(1,n+1):
        j = i
        while j <= n:
            f[j] += 1
            j += i
    print(f[1::2].count(8))
    return

#Solve
if __name__ == "__main__":
    solve()

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())

ans = 0

for i in range(1, N+1):

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

print(ans)

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, int(pow(i, 0.5)) + 1):
            if i % j == 0:
                cnt += 1
                if j != i // j:
                    cnt += 1
        if cnt == 8:
            ans += 1

print(ans)

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 cnt == 8:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
from math import sqrt
N = int(input())
ans = 0
for i in range(7, N+1):
  if i%2==0:
    continue
  c = 0
  for j in range(1, int(sqrt(i))+1):
    if i%j==0:
      c+=2
  if c==8:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
from math import sqrt
N = int(input())
ans = 0
for i in range(7, N+1):
  if i%2==0:
    continue
  c = 0
  for j in range(1, int(sqrt(i))+1):
    if i%j==0:
      if i//j==j:
        c+=1
      else:
        c+=2
  if c==8:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
# Author: cr4zjh0bp
# Created: Mon Mar  9 08:24:08 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

N = ni()
ans = 0
for i in range(1, N + 1):
    cnt = 0
    if i % 2 == 0:
        continue
    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:
'''
制約 1< n< 200
'''
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,2):
    count=0
    for j in range(1,i+1,2):
        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(1,n+1,2):
    ct=0
    for j in range(1,i+1):
        if i%j==0: ct+=1
    if ct==8: ans+=1
print(ans)

Submission status: Accepted

Solution code:
# B
# 2020/03/09  0:11-
n = int(input())

def yakusu(x):
    l = []
    for i in range(1, x+1):
        if x%i == 0:
            l.append(i)
    return l

count = 0
for i in range(1, n+1):
    A = yakusu(i)
    if len(A) == 8 and i%2 == 1:
        count += 1
        
print(count)

Submission status: Accepted

Solution code:
n = int(input())
odd = [i for i in range(1, n + 1) if i % 2 is not 0]
ans = [ii for ii in odd if len([x for x in range(1, ii + 1) if ii % x is 0]) == 8]
print(len(ans))

Submission status: Accepted

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

rst = 0
for i in range(1, n+1):
    if i % 2 == 0:
        continue

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

    if cnt == 8:
        rst += 1

print(rst)

Submission status: Accepted

Solution code:
def count_divisor(n):
    a = 0
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            a += 1
            if i != n // i:
                a += 1
    return a

if __name__ == '__main__':
    n = int(input())
    c = 0

    for i in range(1, n + 1):
        if i % 2 == 0:
            continue
        if count_divisor(i) == 8:
            c += 1
    print(c)

Submission status: Accepted

Solution code:
N = int(input())
cnt = 0
ans = 0
for i in range(1,N+1,2):
    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:
import math
N=int(input())
ans=0
for i in range(1,N+1):
    if i%2==0:
        continue
    cnt=0
    for k in range(1,i+1):
        if i%k==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)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

ct=0
for n in range(1,N+1):
    if n%2!=0 and NumOfFractional(n)==8:
        ct+=1
print(ct)

Submission status: Accepted

Solution code:
def divisors(n: int) -> list:
    d = []
    for i in range(1, n + 1):
        q, r = divmod(n, i)
        if r == 0:
            d.append(i)
    return d


N = int(input())

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

print(ans)

Submission status: Accepted

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

N=int(input())
res=0
for i in range(1,N+1,2):
    if divCnt(i)==8:
        res+=1
print(res)

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
result = 0
target = 1
while target <= N:
    div, div_count = 1, 0
    while div <= N:
        if target % div == 0:
            div_count += 1
        div += 2
    if div_count == 8:
        result += 1
    target += 2
print(result)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
def solve(x):
    if x%2==0:return False
    res = 0
    for i in range(x):
        if x%(i+1)==0:res += 1
    return res == 8
n = int(input())
ans = 0
for i in range(n):
    if solve(i+1):ans+=1
print(ans)

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


ans = 0
for i in range(1, n+1):
    if make_divisor(i) == 8:
        ans += 1
print(ans)

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 cnt==8: ans+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1, n+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:
#!/usr/bin/env python3

N = int(input())
# print(N)

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

print(result)

Submission status: Accepted

Solution code:
N = int(input())

res = 0
for n in range(3,N+1,2):
    cnt = 0 # 自分含む
    for i in range(1,n+1):
        if n % i == 0:
            cnt += 1
        if cnt == 8:
            res += 1
print(res)

Submission status: Accepted

Solution code:
import math
N = int(input())
def yakusuu(N):
    P = [1,N]
    for k in range(2,math.floor(math.sqrt(N))+1):
        if N % k == 0:
            P.append(k)
            P.append(N//k)
    return len(set(P))
ans = 0
for k in range(1,N+1,2):
    if yakusuu(k) == 8:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC106

n = int(input())

# (1+p)(1+q)(1+r)
# 2*2*2=8
# (1+p+p^2+p^3)(1+q)
# 4*2=8

# p = [3,5,7,11,13,17,19]

l = [1,3*5*7,3**3*5,3*5*11,3**3*7,3*5*13,201]

for i in range(6):
    if l[i] <= n < l[i+1]:
        print(i)
        break

Submission status: Accepted

Solution code:
from collections import defaultdict
from math import sqrt
def primeFactors(n):
    d = defaultdict(int)
    while n % 2 == 0:
        d[2] += 1
        n = n // 2
    for i in range(3,int(sqrt(n))+1,2):
        while n % i == 0:
            d[i] += 1
            n = n // i
    if n > 2:
        d[n] += 1

    return d

if __name__ == '__main__':
    N = int(input())
    ans = 0
    for i in range(3, N+1, 2):
        d = primeFactors(i)
        num_of_factor = 1
        for _, v in d.items():
            num_of_factor = num_of_factor * (v + 1)
        if num_of_factor == 8:
            ans += 1

    print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

    if tmp == 8:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
MAX_N = 200
N = int(input())
a = [3, 5]
i = 7
while 3 * 5 * i < MAX_N:
  a.append(i)
  i += 2
len_a = len(a)
dot = []
for j in range(len_a-2):
  for k in range(j+1, len_a-1):
    for l in range(k+1, len_a):
      d = a[j] * a[k] * a[l]
      if d < MAX_N:
        dot.append(a[j] * a[k] * a[l])
dot = sorted(dot)
r = 0
for x in dot:
  if x <= N:
    r += 1
  else:
    break
print(r)

Submission status: Accepted

Solution code:
N = int(input())

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

ans = 0
for i in range(3, N + 1, 2):
    if count(i) == 8:
        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:
import sys
input = sys.stdin.readline


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())
cnt = 0

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

print(cnt)

Submission status: Accepted

Solution code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):  # リストに重複した要素があるか判定（要素にリストがある場合）
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


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


#a, b, c, d = map(int, input().split())
#print(a, b, c, d)
#x = ((a-c)**2+(b-d)**2)**0.5
# print(x)
n = int(input())
# print(divisor(n))

cnt = 0
for i in range(1, n+1):
    # print(divisor(i))
    # print(len(divisor(i)))
    if i % 2 != 0 and len(divisor(i)) == 8:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
def hantei(n):
    root_n = int(n**0.5 +0.5)
    
    if root_n**2 == n:
        return 0
    
    total = 0
    for i in range(1,root_n):
        if n % i == 0:
            total += 2
            
    return total
    
n = int(input())

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

print(total)

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:
# 約数全探索
# https://atcoder.jp/contests/abc106/tasks/abc106_b

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

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