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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

count8=0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

ans(105)
res = 0
for i in range(n+1):
    if ans(i):
        res += 1
        
print(res)

Submission status: Accepted

Solution code:

n = int(input())

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

ans = 0

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

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = 0
for i in range(1,N+1,2):
    now = 0
    for j in range(1,math.ceil(math.sqrt(i))+1):
        if i%j == 0:
            now += 2
    if now == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

ret = 0
for ni in range(1, n+1):
    if ni % 2 == 0 :continue
    divisors = make_divisors(ni)
    if len(divisors) == 8:
        ret += 1

print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())


def divisor(x):
    div = []
    div_append = div.append
    for i in range(1, int(x**.5)+1):
        if x % i == 0:
            div_append(i)
            div_append(x//i)
    div.sort()
    return div

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

Submission status: Accepted

Solution code:
def make_divisors(n) -> list:
    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(105, N+1, 2):
    if len(make_divisors(i)) == 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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
c = 0
for i in range(1,n+1):
    if i%2 == 0:
        c = 0
    else:
        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):
    cnt = 0
    for j in range(1, i + 1):
        if i % j == 0:
            cnt += 1
    if cnt == 8 and i % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#xの約数の数を数える関数
def divNum(x):
    tmp = set()
    i = 1
    while i < x**0.5:
        if x%i == 0:
            tmp.add(i)
            tmp.add(x//i) 
        i+=1
    return len(tmp)

def main():
    n = int(input())
    cnt = 0
    for i in range(1, n+1):
        if i%2 == 0:
            continue
        if divNum(i) == 8:
            cnt += 1
    print(cnt)
main()

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

    # print(divisors)
    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())

ans = 0
for i in range(1, N+1, 2):
    if i==1:
        continue
    count = 0
    for j in range(1, int(i**0.5)+1, 1):
        if i%j==0:
            count = count + 1
    if count==4:
        ans = ans + 1

print(ans)

Submission status: Accepted

Solution code:
N=int(input())

b=0
for i in range(N):
  a=0
  for j in range(i+1):
   
    if a==9:
      b=b-1
      break
    if (i+1)%2!=0 and (i+1)%(j+1)==0:      
      a=a+1
    if a==8:
      b=b+1

print(b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1,n+1,2):
    p = set()
    for j in range(2, int(i**0.5+1)):
        if i % j == 0:
            p.add(j)
            p.add(i/j)
    if len(p) == 6:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
import sys
inf = 10**9+7
mod = 10**9+7

# 約数生成
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(3,n+1,2):
    num = len(make_divisors(i))
    if num == 8:
        ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
icase=0
if icase==0:
    def cd(nn):
        nnn=int(nn**0.5)+1
        cdl=set()
        for i in range(1,nnn):
            if nn%i==0:
                r=nn//i
                if not i in cdl:
                    cdl.add(i)
                if not r in cdl:
                    cdl.add(r)
        return len(cdl)            
            
    n=int(input())
    if n<105:
        print(0)
    elif n==105:
        print(1)
    else:
        icnt=1
        for nn in range(107,n+1,2):
            if cd(nn)==8:
                icnt+=1
#                print(nn)
        print(icnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
prime = [3,5,7,11,13] #9は素数ではない！
count = 0
#x^1, y^1,z^1の場合
for i in range(5):
    for j in range(i+1, 5):
        for k in range(j+1, 5):
            if prime[i]*prime[j]*prime[k] <=N:
                count += 1

#x^3, y^1の場合
for i in range(4):
    for j in range(i+1, 4):
        if prime[i]**3 * prime[j] <= N:
            count+= 1
        if prime[i] * prime[j]**3 <= N:
            count += 1
print(count)
"""
count = 0
for i in range(1,N+1,2):
    yakusuu = 0
    for j in range(1,i+1):
        if i%j == 0:
            yakusuu += 1
    if yakusuu == 8:
        print(i)
        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, 2):
        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

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

print(count)

Submission status: Accepted

Solution code:
N=int(input())

i=1
ans=0
while i<=N:
    j=1
    count=0
    while j<=i:
        count+=1*(i%j==0)
        j+=1
    ans+=1*(count==8)
    i+=2

print(ans)

Submission status: Accepted

Solution code:
#105という数は, 非常に特殊な性質を持つ - 奇数なのに, 約数が 8個もある.
#さて, 1以上 N以下の奇数のうち, 正の約数を ちょうど 8個持つようなものの個数を求めよ.
#1<=N<=200

N = int(input())

Nlist = list(range(1,N+1, 2))
ans = 0
for n in Nlist:
    tmp = 1
    for i in range(1, (N+1)//2):
        if n % i == 0:
            tmp += 1
    if tmp == 8:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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


#tmp = factorization(n)
#print(tmp)

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

Submission status: Accepted

Solution code:
# solution
import io

data = int(input())
if data<105:
  print(0)
elif 104<data<135:
  print(1)
elif 134<data<165:
  print(2)
elif 164<data<189:
  print(3)
elif 188<data<195:
  print(4)
else:
  print(5)

Submission status: Accepted

Solution code:
#from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"

def main():
    n = ii()
    cnt = 0
    for i in range(1,n+1):
        if not i%2:
            continue
        tmp = 0
        for j in range(1,i+1):
            if not i%j:
                tmp+=1
        if tmp == 8:
            cnt+=1
    print(cnt)


main()

Submission status: Accepted

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

Submission status: Accepted

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

cnt=0
i=1
n=int(input())
while i<=n:
	if make_divisors(i)==8:
		cnt+=1
	i+=2
print(cnt)

Submission status: Accepted

Solution code:
import math
"""
方針
nは１<= n <= 200なので、
あらかじめ200まで全探索 O(n*2*√n)
"""
def countyakusu(n):
    cnt = 0
    for i in range(1,int(math.sqrt(n))+1):
        if n%i == 0:
            cnt += 1
            if i != n//i:
                cnt += 1
    return cnt
result = [0]*200
for i in range(1,201):
    if i%2 != 0:
        result[i-1] = countyakusu(i)

n = int(input())
cnt = 0
for i in range(n):
    if result[i] == 8:cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
def I(): return int(input())
N = I()
ans = 0
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 I(): return int(input())
N = I()
ans = 0
if N>=105:
    for i in range(105,N+1):
        yakusuu = []
        if i%2==1:
            for j in range(1,int(i**0.5)+1):
                if i%j==0:
                    yakusuu.append(j)
                    yakusuu.append(i//j)
        if len(yakusuu)==8:
            ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
count = 0
from math import sqrt
for i in range(1,N+1)[::-1]:
    if i%2==1:
        yakusu = 0
        for j in range(1,i+1):
            if i%j==0:
                yakusu += 1
        
        if yakusu == 8:
            count += 1
print(count)

Submission status: Accepted

Solution code:
n = int(input())
divisorcount8 = 0
for m in range(1, n + 1, 2):
  kcount = 0
  for k in range(1, m + 1, 2):
      if (m % k  == 0):
        kcount += 1
  if kcount == 8:
    divisorcount8 += 1
print(divisorcount8)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip() # ignore trailing spaces 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

def abc_b106(num):#numの約数が8個だったらTrueを返す
    cnt = 0
    for i in range(1,num+1):
        if num%i == 0:
            cnt+=1
        if cnt > 8:
            return False
    if cnt == 8:
        return True
    else:
        return False

def main():
    n = ni()
    ans = 0
    for i in range(1,n + 1):
        if i%2 == 1:
            if abc_b106(i):
                ans += 1
    print(ans)
    return

if __name__ == '__main__':
    main()

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:
N = int(input())
c = 0
for  i in range(1,N+1):
  if i % 2 == 0:
    continue
  li = []
  if i < 10:
    continue
  else:
    k = i
    for j in range(2,int(i**(0.5)+3)):
      d = 1
      while k % j == 0:
        k = k/j
        d += 1
      if d != 1:
        li.append(d)
    ss = 1
    for x in li:
      ss *= x
    if ss == 8:
      #print(i)
      c += 1
    
print(c)

Submission status: Accepted

Solution code:
# ABC 106: B – 105
n = int(input())
num = 0

for i in range(1, n + 1, 2):
    divides = 0

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

    if divides == 8:
        num += 1

print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

def Y(num):
 cnt = 0
 for i in range(1,int(num**0.5+1)):
  if num % i == 0:
   cnt += 1
   if i != num**0.5:
    cnt += 1
 return cnt
            
res = 0
for i in range(n+1):
 if i%2 == 0:
  continue
 if Y(i) == 8:
  res += 1

print(res)

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

Submission status: Accepted

Solution code:
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

N = ni()

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(reverse=True)
    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())
total = 0
for x in range(8,N+1):
  result = 0
  for y in range(1,(x//2)+1):
    if x%y == 0 and y%2==1:
      result += 1
  if result == 7:
    total += 1
print(total)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

c = 0
for i in range(2,N+1):
    if i%2 == 1:
        s = factorization(i)
        ans = 1
        for j in range(len(s)):
            ans *= (s[j][1] +1)
        if ans == 8:
            c += 1

print(c)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())


def divisors(n):
    divisors = []
    for i in range(1, n // 2 + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    return set(divisors)


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

print(c)

Submission status: Accepted

Solution code:
num = int(input())
ans = 0
for i in range(1, num+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:
def countyaku(m):
    count = 0
    for i in range(1,m+1):
        if m%i==0:
            count += 1
    if count == 8:
        return True
    else:
        return False
n = int(input())
if n<105:
    print(0)
else:
    ans = 0
    for j in range(105,n+1,2):
        if countyaku(j):
            ans += 1
    print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

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

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

print(count)

Submission status: Accepted

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

# 105 = 3 * 5 * 7
# yakusu = 1, 3, 5, 7, 15, 21, 35, 105

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.append(i)

print(len(ans))

Submission status: Accepted

Solution code:
N = int(input())
def divisore(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(reverse=True)
    return divisors

ans = 0
for i in range(1,N+1):
    if i % 2 == 0:
        continue
    li = divisore(i)
    if len(li) == 8:
        ans +=1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

d = []
cnt = 0
for i in range(1,N+1):
    if i % 2 == 1:
        for j in range(1,int(i**0.5)+1):
            if i % j == 0:
                d.append(j)
                if j != i//j:
                    d.append(i//j)
        if len(d) == 8:
            cnt +=1
        d = []
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def wari(a,i):
    if(a%i == 0):
        return 1
    else:
        return 0

def yakusum(n):
    sum = 1
    for i in range(1,n//2):
        sum += wari(n,i)
    return sum


n = int(input())
sum = 0
for i in range(105,n+1,2):
    if yakusum(i) == 8:
        sum += 1

print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
def divisor_all(n): # 約数全列挙
    l = [1,n]
    for i in range(2,int(pow(n,1/2))+1):
        if n % i == 0:
            if i == n//i:
                l.append(i)
            else:
                l.append(i)
                l.append(n//i)
    l.sort()
    return l # list
ans = 0
for i in range(1,N+1,2):
    if len(divisor_all(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 divisors

n = int(input())
make_divisors(n)
len(make_divisors(n))
ans = 0
ans_list = []

for i in range(1,n+1):
    if len(make_divisors(i)) == 8 and i % 2 == 1:
        ans += 1
        ans_list.append(i)
# print(ans_list)
print(ans)

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

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

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:
import numpy as np
n = int(input())
ans =0
for i in range(1,n+1):  
    if(i%2==0):
        continue
    count=0
    for j in range(1,i+1):
        if(i%j == 0):
            count += 1
    if(count == 8):
            ans+=1
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
s=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 divisors
for i in range(N):
  if (i+1)%2!=0:
    if len(make_divisors(i+1))==8:
      s+=1
print(s)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(N):
    i += 1
    if i%2 == 1:
        yakusu = 0
        for j in range(i):
            if i % (j+1) == 0:
                yakusu += 1
        if yakusu == 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
count=0
for i in range(1, N+1, 2):
  lis = make_divisors(i)
  if len(lis) == 8:
    count += 1
print(count)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline # 改行コード「\n」を呼んでしまうため、文字数など、注意！！

n = int(input())
ans = 0

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

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

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

print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def sum_up(num):
    cnt_n = 0
    for i in range(105, num+1, 2):
        tmp = 0
        for j in range(1, i+1):
            if(i%j == 0):
                tmp += 1
                if(tmp > 8):
                    break
        if(tmp == 8):
            cnt_n += 1
    return cnt_n
    
if(N < 105):
    print(0)
else:
    ans = sum_up(N)
    print(ans)

Submission status: Accepted

Solution code:
#python3

def div(x):
    a = []
    i = 1
    while i*i<x:
        if x%i == 0:
            a.append(x//i)
            a.append(i)
        i+=1
    n = len(a)
    return n 

def main():
    n = int(input())
    c = 0
    for i in range(1, n+1):
        if (i%2 != 0) and (div(i) == 8):
            c += 1
    print(c)
main()

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

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

n=int(input())
x=0
for i in range(n+1):
    if i%2==0:
        continue
    else:
        if yaku(i)==8:
            x+=1
print(x)

Submission status: Accepted

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

Submission status: Accepted

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