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

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

Submission status: Accepted

Solution code:
# coding: utf-8

N = int(input())

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

print(count)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

n = int(input())

def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    
    return table

table = num_divisors_table(n)
ans = 0
for i in range(1, n + 1, 2):
    if table[i] == 8:
        ans += 1
print(ans)

Submission status: Accepted

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

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

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:
n=int(input())
#n,m=map(int,input().split())
#hl=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

def divnum(n):
    res=0
    for i in range(1,n+1):
        if n%i==0:
            res+=1
    if res==8:
        return True
    else:
        return False
count=0
for i in range(1,n+1):
    if i%2!=0 and divnum(i):
        count+=1
print(count)

Submission status: Accepted

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

N = int(input())
ans = 0
for i in range(1,N+1):
    if i % 2 != 0:
        if yakusuu(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 is 0:
        continue
    for j in range(1, i):
        if (i/j).is_integer():
            count += 1
        if j == i-1 and count == 7:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
from math import sqrt, ceil
n = int(input())
ans = 0
for i in range(1, n+1, 2):
    score = 0
    for d in range(1, ceil(sqrt(i))+1):
        p, m = divmod(i, d)
        if m == 0:
            if p != d:
                score += 2
            else:
                score += 1
    if score == 8:
        ans += 1
print(ans)

Submission status: Accepted

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

resolve()

Submission status: Accepted

Solution code:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

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

resolve()

Submission status: Accepted

Solution code:
def Div(N):
    L = []
    R = []
    I = 1
    while I*I<=N:
        if N%I==0:
            L.append(I)
            if I!=(N//I):
                R.append(N//I)
        I += 1
    return L+R[::-1]

N = int(input())
Count = 0
for T in range(1,N+1,2):
    if len(Div(T))==8:
        Count += 1
print(Count)

Submission status: Accepted

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

Submission status: Accepted

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

for n in range(N+1):
  if n%2==1:
    Y = 0
    for m in range(1,N+1):
      if n%m==0:
        Y+=1
    if Y==8:
      ans+=1
    
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

n = int(input())
# print(f"{n}")

ans = 0
for i in range(1, n + 1):
    if i % 2 == 0:
        continue
    
    # d_count = sympy.divisor_count(i)
    a = make_divisors(i)
    # print(f"{i} {a}")
    d_count = len(a)
    # print(f"{i} {d_count}")
    if d_count == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

def divisor(n):
    res = []
    i = 1
    while i*i <= n:
        if n % i == 0:
            res.append(i)
            if i != n//i:
                res.append(n // i)
        i += 1
    return res

ans = 0
for i in range(1, N+1, 2):
    res = len(divisor(i))

    ans += 1 if res == 8 else 0

print(ans)

Submission status: Accepted

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

N = int(input())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import sqrt

def yakusuu8(n):
    lst = []
    m = int(sqrt(n)) + 2
    for i in range(2, m):
        if n % i == 0:
            j = 1
            while True:
                if n % i == 0:
                    n //= i
                    j += 1
                else:
                    lst.append(j)    
                    break
    if n != 1:
        lst.append(2)
        
    yakusuu = 1
    for i in range(len(lst)):
        yakusuu *= lst[i]
    
    if yakusuu == 8:
        return True
    else:
        return False

n = int(input())

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

else:
    ans = 0
    for i in range(105, n + 1)[::2]:
        ans += yakusuu8(i)
    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, 2):
    if len(make_divisors(i)) == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

totalcount = 0

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

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

n = I()
ans = 0
if n < 105:
    print(0)
    exit
else:
    for i in range(105, n+1, 2):
        cnt = 0
        for q in range(1,i+1):
            if i % q == 0:
                cnt += 1
        if cnt == 8:
            ans += 1
    print(ans)

Submission status: Accepted

Solution code:
import collections
n = int(raw_input())
count = 0
cc= collections.Counter()
for i in range(1,n + 1):
	j = i
	while(j <= n):
		cc[j] += 1
		j +=i
	if i % 2 and cc[i] == 8 :
		count +=1
print count

Submission status: Accepted

Solution code:
from math import sqrt

N = int(input())
ans = 0
for M in range(105,N+1,1):
    if M%2==0:
        continue 
    count=0
    for i in range(1,int(sqrt(M))+2,1):
        if M % i ==0:
            if M % i == 0:
                count+=2
    if count==8:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

A = [0]*(N+1)
for i in range(1, N+1):
    for j in range(i, N+1, i):
        A[j] += 1

count = 0
for i in range(1, N+1):
    if i%2 == 1 and A[i] == 8:
        count += 1
print(count)

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 make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

N = int(input())

s = list(range(1,N+1,2))
ans = 0
for i in s:

    if len(make_divisors(i)) == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

table = ['x'] + ([0] * N)
for i in range(1,N+1):
    for j in range(i,N+1,i):
        table[j] += 1

ans = 0

for i in range(1,N+1,2):
    if table[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:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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:
def solve():
    N = int(input())
    n = [0 for _ in range(N + 1)]
    for i in range(1, N + 1):
        if i % 2:
            for j in range(i, N + 1, i):
                n[j] += 1
    print(n.count(8))


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
n=int(input())
ans=0
for i in range(1,n+1):
  cnt=0
  if i%2==0:continue
  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:
print(len([i for i in range(int(input())) if i+1 in[105,135,165,189,195]]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
for i in range(201):
    if i % 2 == 0:
        continue
    cnt = 0
    for j in range(1, i+1):
        if i % j == 0:
            cnt += 1
    if cnt == 8:
        print(i)
        
出力
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:
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 i%2 == 1 and count == 8:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
              
def primes(n):
    p = []    
    i = 1     
    while True:
        i += 1
        if i * i > n:
            break
        ok = True
        for j in p:
            if i % j == 0:
                ok = False
                break
        if ok:
            p.append(i)
    return p  
p = primes(n) 
              
ans = 0       
for i in range(1, len(p)):
    for j in range(i+1, len(p)):
        for k in range(j+1, len(p)):
            if p[i] * p[j] * p[k] <= n:
                ans += 1
              
for i in range(1, len(p)):
    for j in range(i+1, len(p)):
        if p[i] * p[i] * p[i] * p[j] <= n:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
c = [0] * (n + 1)
for i in range(1, n + 1):
    for j in range(1, n // i + 1):
        c[j * i] += 1
print(sum(c[i] == 8 for i in range(1, n + 1, 2)))

Submission status: Accepted

Solution code:
n=int(input())

ans=0
for i in range(1,n+1,2):
  cou=0
  for j in range(1,n+1):
    if i%j==0:
      cou+=1
  if cou==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:
def div(x):
    cnt = 0
    for i in range(1, x + 1):
        if x % i == 0:
            cnt += 1
    return cnt


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:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def yakusu(x):
    A=[]
    for i in range(1,x+1):
        if x%i==0:
            A.append(i)
    return(len(A))
    
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())
l = [i for i in range(1, n+1) if i % 2 == 1]
ans = 0
for i in l:
  cnt = 0
  for x in range(1, i+1):
    if i % x == 0:
      cnt += 1
  if cnt == 8:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
from decimal import Decimal
from operator import mul

INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)


# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

# 素因数分解
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

# 組合せnCr
def combinations_count(n, r):
    if n < r:
        return 0
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

# 2数の最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

# リストの要素の最小公倍数
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

# リストの要素の最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

# 素数判定
def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True


# limit以下の素数を列挙
def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

# 同じものを含む順列
def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        # set（集合）型で重複を削除、ソート
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

# ここから書き始める
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(105, n + 1, 2):
    c = 0
    for d in range(1, i + 1, 2):
        if i % d == 0:
            c += 1
    if c==8:
        ans += 1
 
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
array_8 = defaultdict(int)
N = int(input())
if not ( 1 <= N <= 200 ): sys.exit()

for A in range(2,N+1):
    if A % 2 == 1:
        for I in range(2,N // 2):
            if A % I == 0:
                array_8[A] += 1

result = 0
for J in array_8:
    if array_8[J] == 6:
        result += 1
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(count)

Submission status: Accepted

Solution code:
n = int(input())

answer = []
for i in range(1,n+1,2):
  check = 0
  for j in range(1,i+1):
    if (i) % j == 0:
      check += 1
      
  if check == 8:
    answer.append(i)
    
print(len(answer))

Submission status: Accepted

Solution code:
N=int(input())
L=[0 for i in range(N+1)]

for i in range(1,N+1):
    for j in range(1,N+1):
        if i*j<=N:
            L[i*j]+=1
cnt=0
for i in range(N+1):
    if i%2!=0 and L[i]==8:
        cnt+=1
print(cnt)
#print(L)

Submission status: Accepted

Solution code:
N = int(input())
l = [105, 135, 165, 189, 195]
for i in range(5):
    if N < l[i]:
        print(i)
        exit()
print(5)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())


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


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

Submission status: Accepted

Solution code:
import math

def countDividers(n):
    divisors = []
    for i in range(1, int(math.sqrt(n))+1):
        if n % i == 0:
            divisors.append(i)
            divisors.append(int(n/i))
    return len(divisors)


if __name__ == '__main__':
    n = int(input())
    count = 0
    for i in range(1,n+1):
        if i %2 ==1 and countDividers(i) == 8:
            count += 1
           
    print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1,n+1):
    num = 0
    for j in range(1,n+1):
        if i%j == 0:
            num += 1
    if num == 8 and i%2 == 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:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
ans = 0
for i in range(105, n+1, 2):
  cnt = 1
  for k in range(3, int(i**0.5)+1, 2):
    if i % k == 0:
      cnt += 1
  if cnt == 4:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
if n < 105:
    print(0)
else:
    for i in range(1,n+1,2):
        count = 0
        for l in range(1, i+1, 2):
            if i % l == 0:
                count += 1
        if count == 8:
            ans += 1
    print(ans)

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    d = [0]*(n+1)
    for i in range(1, n+1):
        for j in range(i, n+1, i):
            d[j] += 1
    ans = 0
    for i in range(n+1):
        if i%2 and d[i] == 8:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
number = int(input())

num_eight_divisors = 0

numbers = list(range(9, number + 1, 2))

for i in range(9, number + 1, 2):
    divisors = [1, i]

    for j in range(2, i):
        q, mod = divmod(i, j)

        if mod == 0:
            divisors.append(j)
            divisors.append(q)

    if len(set(divisors)) == 8:
        num_eight_divisors = num_eight_divisors + 1

print(num_eight_divisors)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
sqrt = 1

for i in range(1,n+1,2):
    if i == sqrt*sqrt:
        sqrt += 1
        continue
    elif i > sqrt*sqrt:
        sqrt += 1
    count = 0
    for j in range(1,sqrt,2):
        if i%j == 0:
            count += 1
    if count == 4:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
ans = 0
N = int(input())
for n in range(1, N+1):
    if n%2 != 0:
        if len(make_divisors(n)) == 8:
            ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return len(lower_divisors + upper_divisors[::-1])


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:
N = int(input())

def make_divisors(n):
    ans = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ans += 1
            if i != n // i:
                ans += 1
    return ans

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

print(ans)

Submission status: Accepted

Solution code:
""" tutorial02
    https://atcoder.jp/contests/abc106/tasks/abc106_b
"""
import sys
import math

def f(n):
    count = 0
    for j in range(1, int(math.sqrt(n)+1)):
        if n % j == 0:
            count = count + (2 if n / j != j else 1)
            if count > 8:
                break

    return count

def main(n):
    """ main
    """
    result = 0

    for i in range(1, n+1):
        if i % 2 == 1 and 8 == f(i):
            result = result + 1

    return result

if __name__ == "__main__":
    N = int(sys.stdin.readline())

    print(main(N))

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

def get_input() -> int:
    """
    標準入力を取得する.

    Returns:\n
        int: 標準入力
    """
    N = int(input())

    return N


def main(N: int) -> None:
    """
    メイン処理.

    Args:\n
        N (int): 1以上200以下の整数
    """
    # 求解処理
    ans = 0
    for n in range(1, N + 1, 2):
        divisors_count = 0
        for i in range(1, n + 1):
            if n % i == 0:
                divisors_count += 1
        if divisors_count == 8:
            ans += 1

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    N = get_input()

    # メイン処理
    main(N)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 標準入力を取得
N = int(input())

# 求解処理
ans = 0
for n in range(1, N + 1, 2):
    divisors_count = 0
    for i in range(1, n + 1):
        if n % i == 0:
            divisors_count += 1
    if divisors_count == 8:
        ans += 1

# 結果出力
print(ans)