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: Wrong Answer

Solution code:
#約数が8個の時、数の素因数を2^a, 3^b, ...とすると(a+1)*(b+1)*... = 8となる
#Nまでの素数を出す
N = int(input())
N_MAX = 200
prime = [1 for i in range(N_MAX+1)]
prime[0], prime[1] = 0, 0
for i in range(2, N_MAX+1):
    if prime[i] == 1:
        for j in range(2*i, N_MAX+1, i):
            prime[j] = 0
prime[2] = 0
ps = []
for i in range(N_MAX+1):
    if prime[i] == 1:
        ps.append(i)
pl = len(ps)
ans = 0
for i in range(pl):
    for j in range(i+1, pl):
        for k in range(j+1, pl):
            if ps[i]*ps[j]*ps[k] <= N:
                ans += 1
            elif (ps[j]**3)*ps[k] <= N or ps[j]*(ps[k]**3) <= N:
                ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
#約数が8個の時、数の素因数を2^a, 3^b, ...とすると(a+1)*(b+1)*... = 8となる
#Nまでの素数を出す
N = int(input())
N_MAX = 200
prime = [1 for i in range(N_MAX+1)]
prime[0], prime[1] = 0, 0
for i in range(2, N_MAX+1):
    if prime[i] == 1:
        for j in range(2*i, N_MAX+1, i):
            prime[j] = 0
ps = []
prime[2] = 0
for i in range(N_MAX+1):
    if prime[i] == 1:
        ps.append(i)
pl = len(ps)
ans = 0
for i in range(pl):
    for j in range(i+1, pl):
        for k in range(j+1, pl):
            if ps[i]*ps[j]*ps[k] <= N:
                #print(ps[i]*ps[j]*ps[k])
                ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
#約数が8個の時、数の素因数を2^a, 3^b, ...とすると(a+1)*(b+1)*... = 8となる
#Nまでの素数を出す
N = int(input())
N_MAX = 200
prime = [1 for i in range(N_MAX+1)]
prime[0], prime[1] = 0, 0
for i in range(2, N_MAX+1):
    if prime[i] == 1:
        for j in range(2*i, N_MAX+1, i):
            prime[j] = 0
ps = []
prime[2] = 0
for i in range(N_MAX+1):
    if prime[i] == 1:
        ps.append(i)
print(ps)
pl = len(ps)
ans = 0
for i in range(pl):
    for j in range(i+1, pl):
        for k in range(j+1, pl):
            if ps[i]*ps[j]*ps[k] <= N:
                #print(ps[i]*ps[j]*ps[k])
                ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
#約数が8個の時、数の素因数を2^a, 3^b, ...とすると(a+1)*(b+1)*... = 8となる
#Nまでの素数を出す
N = int(input())
N_MAX = 200
prime = [1 for i in range(N_MAX+1)]
prime[0], prime[1] = 0, 0
for i in range(2, N_MAX+1):
    if prime[i] == 1:
        for j in range(2*i, N+1, i):
            prime[j] = 0
ps = []
prime[2] = 0
for i in range(N_MAX+1):
    if prime[i] == 1:
        ps.append(i)
pl = len(ps)
ans = 0
for i in range(pl):
    for j in range(i+1, pl):
        for k in range(j+1, pl):
            if ps[i]*ps[j]*ps[k] <= N:
                ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
for i in range(105,n+1):
  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: Wrong Answer

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)
                    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,2):
            if cd(nn)==8:
                icnt+=1
#                print(nn)
        print(icnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
prime = [3,5,7,9,11]
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(5):
    for j in range(i+1, 5):
        if prime[i]**3 * prime[j] <= N:
            count+= 1
print(count)

Submission status: Wrong Answer

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

N = int(input())

Nlist = list(range(1,N+1, 2))
print(Nlist)
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: Wrong Answer

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):
    if i >= 105:
        tmp = factorization(i)
        #print(tmp)

        if len(tmp) >= 2:
            tmp_2 = 0
            for j in tmp:
                tmp_2 += j[1]
            
            if tmp_2 == 3:
                ans += 1

print(ans)

Submission status: Wrong Answer

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 = factorization(i)
#
#    if len(tmp) == 3:
#
#        ans += 1
if n < 105:
    print(0)
elif 105 <= n and n < 165:
    print(1)
elif 165 <= n and n < 195:
    print(2)
else:
    print(3)

Submission status: Wrong Answer

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 = factorization(i)

    if len(tmp) == 3:
        ans += 1

print(ans)

Submission status: Wrong Answer

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: Wrong Answer

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(i, N + 1):
                if i // j == 0:
                    count += 1
            if count == 8:
                num += 1
    print(num)
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
prime = [2]
for i in range(3, 200):
  for j in range(2, i + 1):
    if (i % j) == 0:
      break
  if i == j:
    prime.append(i)
divisorlen = 0
divisorcount8 = 0
skipnum = 0
divisor = []
for m in range(1, n + 1, 2):
  divisor = [1]
  for k in prime:
    skipnum = m
    if k <= skipnum:
      kcount = 1
      while (skipnum % k == 0):
        divisor.append(k)
        skipnum = int(skipnum / k)
        kcount *= k
      divisor.append(kcount)
    else:
      break
  divisorlen = len(divisor)
  divisor.clear()
  if divisorlen == 8:
    divisorcount8 += 1
print(divisorcount8)

Submission status: Wrong Answer

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//2 + 1):
        if abc_b106(i*2 - 1):
            ans += 1
    print(ans)
    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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(n//2 + 1):
        if abc_b106(i*2 + 1):
            ans += 1
    print(ans)
    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
N = int(input())
c = 0
for  i in range(1,N+1):
  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: Wrong Answer

Solution code:
N = int(input())
c = 0
for  i in range(1,N+1):
  li = []
  if i < 10:
    continue
  else:
    k = i
    for j in range(2,int(i**(0.5)+1)):
      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:
      c += 1
    
print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
c = 0
for  i in range(1,N+1):
  li = []
  if i < 10:
    continue
  else:
    k = i
    for j in range(2,int(i**(0.5)+1)):
      while k % j == 0:
        k = k/j
        li.append(j)
    if len(li) == 8:
      c += 1
print(c)

Submission status: Wrong Answer

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):
    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: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0

for i in range(1, n+1):
    count = 0
    if i % 2 == 1:
        for j in range(1, int(math.sqrt(i))):
            if i % j == 0 and j * j != i:
                count += 1
        if count == 4:
            ans += 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0

for i in range(1, n+1):
    count = 0
    if i % 2 == 1:
        for j in range(1, int(math.sqrt(i))):
            if i % j == 0:
                count += 1
        if count == 4:
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
def yaku(n):
    x=0
    for i in range(1,n+1):
        if n%i==0:
            x+=1
    return x//2

n=int(input())
if n<105:
    print(0)
    
elif n%2!=0:
    x=1
    if yaku(n)==8:
        x+=1
    print(x)

Submission status: Wrong Answer

Solution code:
## coding: UTF-8
from decimal import *
from itertools import permutations, combinations,combinations_with_replacement,product
import math


#input
#N
#A1 A2 ... AN
N = int(input())


#約数を表示　計算量sqrt(n)
#IFの判断をサボることで余計な計算量を入れないような作りになっています。
def yakusuu(n):
    #約数全列挙
    l = []
    border = int(math.sqrt(n))
    #print(border) #ここまでしか考えなくて良い
    for i in range(1, border+1):
        #print(i)
        if(n % i == 0):
            l.append(i)
            l.append(int(n/i))
    if(l[-1] == l[-2]):
        del l[-1]
    return l

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

print(counter)

Submission status: Wrong Answer

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

a = 0
for i in range(1,int(input()),2):
    if ABC106C(i)==8:
        a += 1
print(a)

Submission status: Wrong Answer

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


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(10 ** 9)


def main():
    N = int(input())
    if N < 105:
        print(0)
        return

    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

    cnt = 1
    for n in range(106, N + 1):
        if n % 2 == 0:
            d = make_divisors(n)
            if len(d) == 8:
                cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(10 ** 9)


def main():
    N = int(input())
    if N < 105:
        print(0)
        return

    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

    cnt = 1
    for n in range(106, N + 1):
        d = make_divisors(n)
        if len(d) == 8:
            cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 105:
  print(1)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
import numpy 

n = int(input())
num = [3,5,7,11,13,17,19]
k = len(num)
ans =0
for i in range(2 ** k):
    cnt = []
    for j in range(k):
        if ((i >> j)&1):
            cnt.append(num[j])
    if numpy.prod(cnt) <= n   and len(cnt) == 3  :
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy 

n = int(input())
num = [3,5,7,11,13,17,19,23,29,31,37]
k = len(num)
ans =0
for i in range(2 ** k):
    cnt = []
    for j in range(k):
        if ((i >> j)&1):
            cnt.append(num[j])
    if numpy.prod(cnt) <= n   and len(cnt) == 3  :
        ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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
result = 0

for i in range(1,n+1,2):
    if i > 200:
        break
    print(i)
    if len(make_divisors(i)) == 8:
        result += 1
    

print(result)

Submission status: Wrong Answer

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
result = 0

for i in range(1,n+2,2):
    if i > 200:
        break
    #print(i)
    if len(make_divisors(i)) == 8:
        result += 1
    

print(result)

Submission status: Wrong Answer

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
result = 0

for i in range(1,n+2,2):
    #print(i)
    if len(make_divisors(i)) == 8:
        result += 1

print(result)

Submission status: Wrong Answer

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

for i in range(1,N+1):
  a = make_divisors(i)
  if a ==8:
    ans += 1
    
print(int(ans))

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    s = int(input())
    ans =0

    for i in range(1,s+1):
        count =0
        for j in range(1,s+1):
            if i>j:
                continue
            if s % j  == 0:
                 count +=1

        if count ==8:
            ans +=1

    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(range(1,n+1))
k=[27,105,125,165,195]
lk=set(l) & set(ｋ)
print(len(lk))

Submission status: Wrong Answer

Solution code:
N = int(input())

def trial_division(n):
    prime_factors = list()
    while n % 2 == 0:
        prime_factors.append(2)
        n //= 2
    p = 3
    while p * p <= n:
        if n % p == 0:
            prime_factors.append(p)
            n //= p
        else:
            p += 2
    if n != 1:
        prime_factors.append(n)
    return prime_factors

cnt = 0
for i in range(1,N+1,2):
    if len(set(trial_division(i))) == 3:
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys

def resolve():
    N = int(input())
    cnt = 0
    for i in range(1, N, 2):
        if is_8_factors(i):
            cnt += 1
    print(cnt)

def is_8_factors(n):
    nfactors = 2
    upper = n
    div = 3
    while True:
        if upper <= div:
            break
        if n % div == 0:
            nfactors += 2
            upper = n // div
        div += 2

    return True if nfactors == 8 else False

if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

Solution code:
import sys

def resolve():
    N = int(input())
    cnt = 0
    for i in range(1, N, 2):
        if is_8_factors(i):
            cnt += 1
    print(cnt)

def is_8_factors(n):
    nfactors = 2
    upper = n
    div = 3
    while True:
        if upper <= div:
            break
        if n % 3 == 0:
            nfactors += 2
            upper = n // 3
        div += 2

    return True if nfactors == 8 else False

if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
c = 0
n = int(input())
if n%2==1:
    for i in range(1,n+1):
        n%i == 0
        c += 1
        if c == 8:
            print('1')
            sys.exit()
print('0')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

cnt = 0
cnt2 = 0
for i in range(1, N+1, 2):
    cnt = 0
    for j in range(1, N+1):
        if j > i:
            cnt = 0
            break
        if i % j == 0:
            cnt += 1

    if cnt == 8:
        cnt2 += 1

print(cnt2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

n = int(input())

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

    if tmp == 8:
        ans += 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

a = [3,5,7,11]
ax = 3*5*7*11
b = []
for i in range(4):
    b.append(ax//a[i])
c = list(itertools.combinations([0, 1, 2, 3], 2))
for j in range(len(c)):
    b.append(a[c[j][0]]**3 * a[c[j][1]])

ans = 0
for i in b:
    if n >= i:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = [3,5,7,11]
ax = 3*5*7*11
b = []
for i in range(4):
    b.append(ax//a[i])
for j in range(3):
    b.append(a[j]**3 * a[j+1])

ans = 0
for i in b:
    if n >= i:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

count = 0
for i in range(1, N+1):
    yakusu_count = 0

    if i % 2 == 0:
        break

    for j in range(1, N+1):
        if N % j == 0:
            yakusu_count += 1

    if yakusu_count == 8:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
from math import sqrt
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def prime_enumeration(n):
    div = []
    for i in range(1, int(sqrt(n))+1):
        if n % i == 0:
            div.append(i)
        if n // i != i:
            div.append(n // i)
        
    return len(div) == 8


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

    if N < 105:
        print(0)
    else:
        ans = 1
        for i in range(105,200,2):
            if prime_enumeration(i):
                print(i)
                ans += 1
        print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

def trial_div(n):
  factors = []
  f = 2
  while f*f <= n:
    if n % f == 0:
      n //= f
      factors.append(f)
    else:
      f += 1
  if n != 1:
    factors.append(n)
  return factors

res = 0
for i in range(1,N+1):
  if i == 1:
    continue
  if i % 2 == 0:
    continue
  factors = trial_div(i)
  if len(factors) == 3 \
    and factors[0] < factors[1] \
    and factors[1] < factors[2]:
    res += 1
  
print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())

def trial_div(n):
  factors = []
  f = 2
  while f*f <= n:
    if n % f == 0:
      n //= f
      factors.append(f)
    else:
      f += 1
  return factors

res = 0
for i in range(1,N+1):
  if i == 1:
    continue
  if i % 2 == 0:
    continue
  factors = trial_div(i)
  n_divisor = 2**len(factors)
  if n_divisor == 8:
    res += 1
  
print(res)

Submission status: Wrong Answer

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

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

if N < 105:
    print(0)
    exit()
elif N == 105:
    print(1)
    exit()

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import re
from decimal import *

l = sys.stdin.readline()
#l = l.split(' ')
#l = [int(str) for str in l]
n = int(l)

for i in range(3,n+1,2):
  count = 2
  for j in range(2,int(i+1/2)):
    if(i%j == 0):
      count += 1
  if(count == 8):
    print("1")
    exit(0)

print("0")

sys.stdout.flush()

Submission status: Wrong Answer

Solution code:
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
N = int(input())
ans = 0
for i in range(1,N+1):
    if len(divisor_all(i))==8:
        ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
if N<=104 :
  print(0)
else :
  print(1)