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):
    j = 1
    temp = 0
    while j * j <= i:
        if i % j == 0:
            temp += 1
            if j != i // j:
               temp += 1
        j += 1
    if temp == 8:
        cnt += 1
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve(N):
    allcount=0
    if N<105:
        return allcount
    for i in range(105,N+1,2):
        count=0
        for j in range(1,i+1):
            if i%j==0:
                count += 1
        if count==8:
            allcount += 1
    return allcount


N=int(input())
print(solve(N))

Submission status: Accepted

Solution code:
def divisor(num):
  
  count=0
  for i in range(1,num+1):
    if (num%i==0):
      count+=1
  return count
 
n=int(input())
 
if(n<=105):
  if(n==105):
    print(1)
  else:
    print(0)
  exit()

res=1
 
for i in range(106,n+1):
  if(divisor(i)==8 and i%2==1):
    res+=1
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def readinput():
    n=int(input())
    return n

def main(n):
    count=0
    for i in range(3,n+1,2):
        nc=0
        for j in range(1,i+1):
            if(i%j==0):
                nc+=1
        if nc==8:
            count+=1
    return count

if __name__=='__main__':
    n=readinput()
    ans=main(n)
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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:
import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

Submission status: Accepted

Solution code:
n=int(input())

count=0
ans=0
if n<=104:
    ans=0
else:
    for i in range(105,n+1):
        count=0
        for e in range(1,n+1):
            if i%2==0:
                break
            elif i%e==0:
                count+=1
        if count==8:
            ans+=1
print(ans)

Submission status: Accepted

Solution code:
def make_divisors(n):
    """
    約数を列挙
    入力：整数n
    戻り値：約数のリスト

    例
    入力：105
    戻り値：[1, 3, 5, 7, 15, 21, 35, 105]
    """
    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:
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())
count = 0

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


print(count)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def main():
    n = int(input())
    ans = 0
    for m in range(1, n + 1):
        if m % 2 == 0: continue
        factor = 0
        i = 1
        while i * i < m:
            if m % i == 0: factor += 2
            i += 1
        if i * i == m: factor += 1
        if factor == 8: ans += 1
        #print("factor[{}]={}".format(m, factor))
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

def cnt_factor(n):
    cnt = 0
    for b in range(1, n + 1):
        if n % b == 0:
            cnt += 1
    return cnt

cnt_list = []
for i in range(1, N + 1, 2):
    cnt_list.append(cnt_factor(i))

print(cnt_list.count(8))

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

print(ans)

Submission status: Accepted

Solution code:
def has_8_of_divisors(N):
    return len(sum((list({n, N // n}) for n in range(1, int(N ** 0.5) + 1) if not N % n), [])) == 8
print(sum(map(has_8_of_divisors, range(1, int(input()) + 1, 2))))

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

Submission status: Accepted

Solution code:
def factorize(n):
    ans=[]
    while n%2==0:
        ans.append(2)
        n//=2
    f=3
    while f**2<=n:
        if n%f==0:
            ans.append(f)
            n//=f
        else:
            f+=2
    if n!=1:
        ans.append(n)
    return ans

n=int(input())
import collections

count=0
for i in range(1,n+1):
    if i%2==0:
        continue
    ans = collections.Counter(factorize(i))
    ans = ans.values()
    hoge=1
    for j in ans:
        hoge*=(j+1)
    if hoge==8:
        count+=1
print(count)

Submission status: Accepted

Solution code:
import itertools
N=int(input())
prime=[3,5,7,11,13,17,19]

comb = list(itertools.combinations(prime,3))

lst=[]
for i in range(len(comb)):
    temp=comb[i][0]*comb[i][1]*comb[i][2]
    if temp<=200:
        lst.append(temp)

lst.append(135)
lst.append(189)

ans = sum(N>=x for x in lst)
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())
arr = []
for i in range(1, n + 1):
  a = []
  for j in range(1, i + 1):
    if j % 2 == 1:
      if i % j == 0:
        a.append(j)
  if len(a) == 8:
    arr.append(i)
print(len(arr))

Submission status: Accepted

Solution code:
import sys
import itertools
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(read())
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 check(x):
    count = 0
    for num in range(1,x+1,2):
        if x % num == 0:
            count += 1
    return count

N = int(input())
ans = 0
for x in range(1,N+1):
    if check(x) == 8:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n=int(input())
a=[3,5,7,9,11,13,17,19]

count=0
for i in range(len(a)):
  for j in range(i+1,len(a)):
    for k in range(j+1,len(a)):
      if a[i]*a[j]*a[k]<=n:
        count+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

count=0
for M in range(1,N+1):
	lis=[]
	if M%2==1:
		for i in range(1,M+1):
			if M/i == M//i:
				lis.append(i)

		if len(list(set(lis))) == 8:
			count+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())


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

print(ans)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC106B
def main():
    import sys
    N = int(sys.stdin.readline())
    
    def calc(num):
        cnt = 0
        for i in range(num, 0, -1):
            if num  % i==0:
                cnt+=1
        if cnt==8:
            #print(cnt, num)
            return 1
        return 0
        
    
    ans = 0
    for i in range(1, N+1, 2):
        ans +=calc(i)
    print(ans)
    
                    
    

if __name__=='__main__':
    main()

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
# ABC106B

n=int(input())

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

Submission status: Accepted

Solution code:
import sys

n = int(sys.stdin.readline().rstrip("\n"))
count = 0
for num in range(27, n+1, 2):
    divisor = 1
    for p in range(1, num, 2):
        if num % p == 0:
            divisor += 1
    if divisor == 8:
        count += 1
print(count)

Submission status: Accepted

Solution code:
import sys

def main():
    N = int(input())
    
    cnt = 0
    for i in range(1, N+1, 2):
        prime_l = []
        for j in range(1, i+1, 2):
            if i%j==0:
                prime_l.append(j)
        if len(prime_l)==8:
            cnt+=1
    print(cnt)
main()

Submission status: Accepted

Solution code:
#約数をちょうど８個持つ奇数を考える。N以下の整数で、そのような奇数はいくつあるか
N = int(input())
result = []
for i in range(3,N+1,2):
    divisor = []
    for j in range(1,int(i**0.5)+1):
        if i % j == 0:
            divisor.append(j)
            if j**2 != i:
                divisor.append(i//j)
    #print(i,divisor)
    if len(divisor) == 8:
        result.append(i)
print(len(result))

Submission status: Accepted

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

if n < 105:
    count = 0
else:
    for i in range(105, n + 1, 2):
        div_count = 0
        for j in range(1, i + 1):
            if i % j == 0:
                div_count += 1
        if div_count == 8:
            count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

def solve(n):
    tmp=0
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            if n==i**2:
                tmp+=1
            else:
                tmp+=2
    return tmp

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def count_divisor(n):
    divisor = []
    for i in range(1, int(math.sqrt(n)) + 2):
        if n % i == 0:
            j = n // i
            if i != j:
                divisor.append(j)
            divisor.append(i)
    return len(divisor)

n = int(input())
ans = 0
for i in range(1, n+1, 2):
    if count_divisor(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:
        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())
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
    if cnt == 8:
      ans += 1
  cnt = 0

print(ans)

Submission status: Accepted

Solution code:
N  = int(input())
def divisor(n):
    div_list = []
    for i in range(1, int(1+ n**0.5)):
        if n%i == 0 and i**2 == n:
            div_list.append(i)
        elif n%i == 0:
            div_list.append(i)
            div_list.append(int(n/i))
    return div_list
counter = 0

for i in range(1,N+1):
    if i % 2 == 1 and len(divisor(i)) == 8:
        counter += 1
        
print(counter)

Submission status: Accepted

Solution code:
from math import sqrt

N = int(input())

ans = 0

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

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

    if sqrt(i).is_integer():
        cnt -= 1

    if cnt == 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):
    count = 0
    for j in range(1,int(math.sqrt(i))+1):
        if i % j == 0:
            count += 1
    if count == 4:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
if n<105:
    print(0)
    exit()
if n==105:
    print(1)
    exit()
res=1
for i in range(107,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:
        res+=1
print(res)

Submission status: Accepted

Solution code:
n = int(input())

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

print(c)

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 [2 * x + 1 for x in range((n + 1) // 2)]:
    if 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):
    cc = 0
    if i % 2 == 1:
        for j in range(1,i+1):
            if i % j == 0:
                cc += 1
        if cc == 8:
            c += 1

print(c)

Submission status: Accepted

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

for i in filter(lambda x : x % 2 == 1,range(1, n+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())
def yakusuu(n):
    i = 1
    count = 0
    while i != n:
        if n % i == 0:
            count+=1
        i+=1
    return count+1

j = 0
n = 1
counter =0
while (n-1) != N:
    if n%2==1:
        if yakusuu(n)==8:
            counter +=1
    n+=1

print(counter)

Submission status: Accepted

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

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000000)
import numpy as np
from heapq import heapify, heappop, heappush
import copy
from math import ceil
from collections import deque
# queueとして使う場合 push, popleftを使う
from bisect import bisect_left, bisect_right
# bisect_left: 配列の順序関係が崩れない条件で挿入することができる一番左の点
# bisect_right: 配列の順序関係が崩れない条件で挿入することができる一番右の点
# A = [1, 1, 1, 2, 2, 2, 4]
# print(bisect_left(A, 2))  # 3
# print(bisect_right(A, 2))  # 6
# print(bisect_left(A, 3))  # 6
# print(bisect_right(A, 3))  # 6


def main():
    N = int(input())
    num = 0
    for i in range(9, N + 1):
        if i % 2 == 0:
            continue
        d = 0
        for j in range(1, N + 1):
            if i % j == 0:
                d += 1 
        if d == 8:
            num += 1
    print(num)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def divisor(m):
    cnt = 2
    for i in range(3, m, 2):
        if m % i == 0:
            cnt += 1
    return cnt

n = int(input())
if n < 105:
    print(0)
elif n == 105:
    print(1)
else:
    res = 1
    for i in range(107, n+1, 2):
        if divisor(i) == 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:
n=int(input())
ans=0
for i in range(1,n+1,2):
  count=0
  for j in range(1,i+1):
    if i%j==0:
      count=count+1
  if count==8:
    ans=ans+1
else:
  print(ans)

Submission status: Accepted

Solution code:
n = int(input()) 
def yakusu(num):
    list_a = []
    for i in range(1, num//2 + 1):
        if num % i == 0:
            list_a.append(i)
    list_a.append(num)
    return list_a
  
ans = 0
for i in range(1, n + 1):
    if len(yakusu(i)) == 8 and i % 2 ==1:
        ans += 1
        
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for x in range(1, 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)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
from collections import deque
from functools import reduce
import heapq
n = int(input())
#n, m = map(int, sys.stdin.readline().split())
#s = input()
#a = list(map(int, sys.stdin.readline().split()))

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

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

    if an == 8:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


# input
N = int(input())

# check
cnt = 0
for n in range(1, N + 1, 2):
    div = get_divisors(n)
    if len(div) == 8:
        cnt += 1

print(cnt)

Submission status: Accepted

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

    # divisors.sort()
    return divisors

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

    # divisors.sort()
    return divisors
  
for i in range(1, N+1):
  if len(make_divisors(i)) == 8 and i%2 == 1:
    num += 1
    
print(num)

Submission status: Accepted

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

def get_yakusu_num(n):
    m = int(n ** (1/2))
    rep_list = []
    for i in range(1, m + 2):
        if n % i == 0:
            p = n // i
            rep_list.append(i)
            rep_list.append(p)
    return len(set(rep_list))

for i in range(1, n + 1):
    if get_yakusu_num(i) == 8 and i % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

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

ans = 0

for i in range(1, n+1):
    if i % 2 == 0:
        continue
    num = 0
    for j in range(1, math.floor(i / 3) + 1):
        if i % j == 0:
            num += 1
    else:
        if num == 7:
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    n=int(readline())

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

    print(cnt)

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

        #divisors.sort()
        return divisors

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

    return count

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

print(ans)

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy

def make_divisors(n):
    divisors = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            divisors.append(i)
            if i != n//i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
n = int(input())
cnt = 0
for i in range(1,n+1):
    if i%2 == 0:
        continue
    a = make_divisors(i)
    if len(a) == 8:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


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

    lower.extend(reversed(upper))
    return lower


def main():
    N = int(readline())

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

    print(ans)

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# AtCoder
N = int(input())


def make_divisor_list(num):
    divisor_list = []
    divisor_list.append(1)
    for i in range(2, num//2+1):
        if num % i == 0:
            divisor_list.append(i)
    divisor_list.append(num)
    return divisor_list


l = 0
for i in range(1, N+1):
    divisor_list = make_divisor_list(i)
    if len(divisor_list) == 8 and i % 2 != 0:
        l += 1

print(l)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
count = 0
def divisors(n):
    d=[]
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            d.append(i)
            if i!=n//i:
                d.append(n//i)
    d.sort()
    return d
for i in range(n+1):
    if i % 2 == 1:
        if len(divisors(i)) == 8:
            count += 1
    else:
        continue
print(count)

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy

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

cnt = 0
n = int(input())
for i in range(1,n+1):
    if i%2 == 0:
        continue
    a = make_divisors(i)
    if len(a) == 8:
        cnt+=1
print(cnt)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    n = int(input())
    print(yakusuu(n))
    
if __name__ == '__main__':
    main()