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

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

Submission status: Accepted

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

    return count


def answer(n: int) -> int:
    if n < 105:
        return 0

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

    return count


def main():
    n = int(input())
    print(answer(n))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding:UTF-8
import sys
from math import factorial

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

# 約数列挙
def divisorList(a):
    l = 0
    for i in range(1, int(a**0.5)+1):
        if a % i == 0:
            l += 1
            ii = a / i
            if i != ii:
                l += 1
    return l


N = int(input())    # 数字
res = 0
for i in range(1, N+1):
    if i % 2 == 1:
        if divisorList(i) == 8:
            res += 1

print("{}".format(res))

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

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(3,N+1,2):
    num = i
    count = 1
    #yaku = []
    for j in range(1,N//2 +1):
            if num % j == 0:
                count += 1
                #yaku.append(j)
    if count == 8:
        ans += 1
        #print(i,yaku)
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())
if n < 105:
  print(0)
elif n < 135:
  print(1)
elif n < 165:
  print(2)
elif n < 189:
  print(3)
elif n < 195:
  print(4)
else:
  print(5)

Submission status: Accepted

Solution code:
import sys

def div(n):
    count = 0
    for i in range(1, n+1):
        count += 1 if n%i==0 else 0
    return count

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

Submission status: Accepted

Solution code:
N = int(input())

def make_divisor(n):
    divisors = []
    for i in range(1, int(n**.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):
    if len(make_divisor(i)) == 8 and  i%2 == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
# B - 105
N = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = [0]*201

for i in range (1, 201):
	for j in range (i, 201):
		if j%i==0:
			L[j]+=1
            
count = 0

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

print(count)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
i = 1
while i <=n:
    j = 1
    cnt = 0
    while j <= i:
        if i%j == 0:
            cnt +=1
            #print(i,cnt,j)
        j +=1
    if cnt == 8 and i%2 ==1:
        #print(i)
        ans += 1
    i +=1
print(ans)

Submission status: Accepted

Solution code:
in_num = int(input())
check_num = 1
ans_counter = 0



while check_num <= in_num:
	i = 1
	div_counter = 0
	while i <= check_num :
		if check_num % i == 0:
			div_counter += 1
		i += 2
	if div_counter == 8:
		ans_counter += 1
	check_num += 2

print(ans_counter)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A=[3*5*7,3*5*11,3*3*3*5,3*5*13,3*3*3*7]
N=int(input())
print(len([x for x in A if x<=N]))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0
for i in range(1,N+1):
    if i % 2 != 0:
        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())
if 195 <= n:
    print(5)
elif 189 <= n:
    print(4)
elif 165 <= n:
    print(3)
elif 135 <= n:
    print(2)
elif 105 <= n:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    n = I()
    ans = 0
    for i in range(1, n+1):
        cnt = 0
        for j in range(1, i+1):
            if i % j == 0:
                cnt += 1
        if cnt == 8 and i % 2 == 1:
            ans += 1
    print(ans)

main()

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):
    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())
l = [i for i in range(n+1)]
ls = l[1::2]
ans = 0
for i in ls:
    if len(make_divisors(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)
    return divisors

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

print(count)

Submission status: Accepted

Solution code:
n = int(input())
ans = []

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

print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 105の約数は1, 3, 5, 7, 3 * 5, 3 * 7, 5 * 7, 3 * 5 * 7
# ほかにありえるのは
# ①1, 3, 5, 9, ...
# ②1, 3, 5, 11, ...
# ③1, 3, 7, 9, ...
# ④1, 3, 5, 13, ...
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())
cnt, ans = 0, 0
if n == 105:
    print(1)
elif n <= 104:
    print(0)
else:
    for x in range(107,n+1,2):
        cnt = 0
        for y in range(1,x+1):
            if x % y == 0:
                cnt += 1
        if cnt == 8:
            ans += 1
    print(ans+1)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
res = 0
for n in range(1, 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 sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from itertools import combinations
def main():
    def divisor(n):
        i = 1
        t = []
        while i * i <= n:
            if n % i == 0:
                t.append(i)
                t.append(n // i)
            i += 1
        return len(set(t))

    n = int(input())
    r = 0
    for i1 in range(1, n + 1, 2):
        r += 8 == divisor(i1)
    print(r)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

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

    if c == 8:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
N = int(input())
ans = 0
for n in range(1, N+1, 2):
    yaku = 0
    for i in range(1, n+1):
        if n%i==0:
            yaku += 1
    if yaku == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
N = int(input())
ans = 0
for i in range(1, N+1, 2):
    yaku = 0
    for j in range(1, i+1):
        if i%j==0:
            yaku += 1
    if yaku == 8:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

count,ans = 0,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
score=[]
for i in range(1, n+1, 2):
  li=[]
  for j in range(1, n+1):
    if i%j==0:
      li.append(j)
  if (len(li))== 8:
    score.append(i)
long=len(score)
print(long)

Submission status: Accepted

Solution code:
a=int(input())
if a<105:
  print(0)
if 105<=a<135:
  print(1)
if 135<=a<165:
  print(2)
if 165<=a<189:
  print(3)
if 189<=a<195:
  print(4)
if 195<=a:
  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(input())
ans = 0

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

Submission status: Accepted

Solution code:
n=int(input())
maxn=int(n**(1/3))
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
    if tmp==8:
        count+=1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input())

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

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

print(r)

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 += 1
  if div == 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())
L = [0]*200
for i in range(1,n+1,2):
  tmp = 1
  cnt = 0
  while tmp <= i:
    if i % tmp == 0:
      cnt += 1
    tmp += 1
    L[i] = cnt
print(L.count(8))

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
L = [0]*200
for i in range(1,n+1,2):
  tmp = 1
  cnt = 0
  while tmp <= i:
    if i % tmp == 0:
      cnt += 1
    tmp += 1
    L[i] = cnt
print(L.count(8))

Submission status: Accepted

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

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())

a=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:
    a+=1

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import collections
def prime_factor_table(n):
    table = [0] * (n + 1)

    for i in range(2, n + 1):
        if table[i] == 0:
            for j in range(i + i, n + 1, i):
                table[j] = i

    return table

def prime_factor(n, prime_factor_table):
    prime_count = collections.Counter()

    while prime_factor_table[n] != 0:
        prime_count[prime_factor_table[n]] += 1
        n //= prime_factor_table[n]
    prime_count[n] += 1
    keys, values = zip(*prime_count.most_common())

    return values

N = int(input())
table = prime_factor_table(N)
ans = 0
for i in range(1,N+1,2):
    if prime_factor(i,table) == (1,1,1) or prime_factor(i,table) == (3,1) or prime_factor(i,table) == (1,3):
        ans += 1

print(ans)

Submission status: Accepted

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

def II(): return int(input())
def MII(): return map(int, input().split())
def LII(): return list(map(int, input().split()))

def main():
    N = II()

    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)


if __name__ == '__main__':
    main()

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:
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 sympy

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())
count = 0
for i in range(1, n+1):
    if i % 2 == 1:
        # if len(sympy.divisors(i)) == 8:
        if len(make_divisors(i)) == 8:
            count += 1
print(count)

Submission status: Accepted

Solution code:
def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n % i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table

N = int(input())
total = 0

for n in range(1, N + 1, 2):
    if len(divisor(n)) == 8:
        total += 1

print(total)

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):
    if i % 2 == 1 and len(make_divisors(i)) == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
def solve(n):
  cnt = 0
  for i in range(1,n+1):
    if n%i == 0: cnt += 1
  if cnt == 8: return True
  else: return False

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

Submission status: Accepted

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

l = []
for i in range(1, 201):
    if num_div(i) == 0:
        l.append(i)
'''
l = [105, 135, 165, 189, 195]

n = int(input())

for i in range(5):
    if n < l[i]:
        print(i)
        exit()

print(5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
cnt=0
y=[]

for i in range(1,N+1,2):
    for j in range(1,i+1):
        if i%j == 0:
            y.append(j)
    if len(y)==8:
        cnt += 1
    y.clear()
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def I(): return int(input())
N = I()
ans = 0
if N>=105:
    for i in range(105,N+1,2):
        count_yakusuu = 0
        for j in range(1,int(i**0.5)+1):
            if i%j==0:
                count_yakusuu += 2
        if count_yakusuu==8:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:

def solve():
    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):
        if len(make_divisors(i)) == 8 and i%2 == 1:
            ans += 1
    
    print(ans)

if __name__ == "__main__":
    solve()

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

def solve():
    n = int(input())
    ans = 0
    for i in range(1, n+1):
        if len(make_divisors(i)) == 8 and i%2 == 1:
            ans += 1
    
    print(ans)

if __name__ == "__main__":
    solve()

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):
    if len(make_divisors(i)) == 8 and i%2 == 1:
        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 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())
a = 0
for j in range(n):
  j += 1
  if j % 2 != 0:
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= j:
      if j % i == 0:
        lower_divisors.append(i)
        if i != j // i:
          upper_divisors.append(j//i)
      i += 1
    if len(lower_divisors + upper_divisors[::-1]) == 8:
      a += 1
    lower_divisors.clear
    upper_divisors.clear
print(a)

Submission status: Accepted

Solution code:
n = int(input())


def count_divisors(target):
    _i = 1
    _count = 0
    while _i*_i <= target:
        if target % _i == 0:
            _count += 1
            if _i != target // _i:
                _count += 1
        _i += 1
    return _count


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

print(count)

Submission status: Accepted

Solution code:
n = int(input())


def judge(x):
    i = 1
    ans = 0
    while i*i < x:
        if x%i == 0:
            ans+=1
            if (x//i)*i == x:
                ans += 1
        i+=1
    if ans == 8:
        return True
    else:
        return False

ans = 0

for i in range(1,n+1,2):
    if judge(i):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
f = [0 for i in range(n+1)]
for i in range(1,n+1):
    cur = i
    while cur<=n:
        f[cur] += 1
        cur += i 

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
ans=0
o=[a for a in range(1,n+1) if a%2==1]
for i in o:
    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:
A=int(input())
def divisor_enu(N):
   S=1
   for i in range(2,int(N**0.5)+1):
      cnt=0
      if N%i==0:
         while N%i==0:
            cnt+=1
            N//=i
         S*=(cnt+1)
   if N != 1:
      S*=2
   return S
ans=0
for i in range(1,A+1):
   if divisor_enu(i)==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):
  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:
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 ,2):
    divisor_count = 0
    for j in range(1, i + 1):
        if i % j == 0:
            divisor_count += 1
    if divisor_count == 8:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
# 与えられた数値の桁数と桁値の総和を計算する.
def calc_digit_sum(num):
    digits = sums = 0
    while num > 0:
        digits += 1
        sums += num % 10
        num //= 10
    return digits, sums


n = int(input())

answer = 0
for num in range(1, n + 1, 2):
    cnt = 0
    for candidate in range(1, num + 1):
        if num % candidate == 0:
            cnt += 1

    if cnt == 8:
        answer += 1

print(answer)

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

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())
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 i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n = i()

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

Submission status: Accepted

Solution code:
import sys
import math
import numpy as np
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    def f(x):
        cnt = 0
        i = 1
        while i <= x:
            if x % i == 0:
                cnt += 1
            i += 1
        return cnt
    cnt = 0
    n = I()
    for i in range(1,n+1,2):
        if f(i) == 8:cnt += 1
    print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

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

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)