TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)    What is the area of this yard excluding the roads? Find it.

Submission attempts (in order):
A = int(input())
B = int(input())
print((A-1)*(B-1))

A = int(input())
B = int(input())
print((A-1)*(B-1))

ab = raw_input().split()
print((int(ab[0])-1)*(int(ab[1])-1))

ab = raw_input().split()
print((int(ab[0])-1)*(int(ab[1])-1))

A = int(input())
B = int(input())
print((A-1)*(B-1))

A = int(input())
B = int(input())
print((A-1)*(B-1))

ab = raw_input().split()
print((int(ab[0])-1)*(int(ab[1])-1))

ab = raw_input().split()
print((int(ab[0])-1)*(int(ab[1])-1))

ab = input().split()
print((int(ab[0])-1)*(int(ab[1])-1))

ab = input().split()
print((int(ab[0])-1)*(int(ab[1])-1))

ab = input().split()
print((int(ab[0])-1)*(int(ab[1])-1))

ab = input().split()
print((int(ab[0])-1)*(int(ab[1])-1))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted

Accepted

Accepted

Accepted
Problem: There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)    What is the area of this yard excluding the roads? Find it.

Submission attempts (in order):
a,b = map(int, input().split())
print((a-1)*(b-2))

a,b = map(int, input().split())
print((a-1)*(b-2))

a,b = map(int, input().split())
print((a-1)*(b-2))

a,b = map(int, input().split())
print((a-1)*(b-2))

a,b = map(int, input().split())
print((a-1)*(b-1))


a,b = map(int, input().split())
print((a-1)*(b-1))


a,b = map(int, input().split())
print((a-1)*(b-1))


a,b = map(int, input().split())
print((a-1)*(b-1))


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted

Accepted

Accepted

Accepted
Problem: There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)    What is the area of this yard excluding the roads? Find it.

Submission attempts (in order):
A,B = input().split(' ')
A=int(A)
B=int(B)
print(A * B)

A,B = input().split(' ')
A=int(A)
B=int(B)
print(A * B)

i=105
N=input()
N=int(N)
m=5
n=0
x=0
y=0
while i <= N:
  if i % 2 != 0:
    if i % 3 == 0:
      n = int(i / 3)
      while m < n:
        if i % m == 0:
          x = x + 1
        m=m+2
      if x == 4:
        y = y + 1
  x=0
  n=0
  m=5
  i = i + 1
print(y)

i=105
N=input()
N=int(N)
m=5
n=0
x=0
y=0
while i <= N:
  if i % 2 != 0:
    if i % 3 == 0:
      n = int(i / 3)
      while m < n:
        if i % m == 0:
          x = x + 1
        m=m+2
      if x == 4:
        y = y + 1
  x=0
  n=0
  m=5
  i = i + 1
print(y)

A,B = input().split(' ')
A=int(A)
B=int(B)
print(A * B)

A,B = input().split(' ')
A=int(A)
B=int(B)
print(A * B)

i=105
N=input()
N=int(N)
m=5
n=0
x=0
y=0
while i <= N:
  if i % 2 != 0:
    if i % 3 == 0:
      n = int(i / 3)
      while m < n:
        if i % m == 0:
          x = x + 1
        m=m+2
      if x == 4:
        y = y + 1
  x=0
  n=0
  m=5
  i = i + 1
print(y)

i=105
N=input()
N=int(N)
m=5
n=0
x=0
y=0
while i <= N:
  if i % 2 != 0:
    if i % 3 == 0:
      n = int(i / 3)
      while m < n:
        if i % m == 0:
          x = x + 1
        m=m+2
      if x == 4:
        y = y + 1
  x=0
  n=0
  m=5
  i = i + 1
print(y)

A,B = input().split(' ')
A=int(A)-1
B=int(B)-1
print(A * B)

A,B = input().split(' ')
A=int(A)-1
B=int(B)-1
print(A * B)

A,B = input().split(' ')
A=int(A)-1
B=int(B)-1
print(A * B)

A,B = input().split(' ')
A=int(A)-1
B=int(B)-1
print(A * B)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Accepted

Accepted

Accepted

Accepted
Problem: There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)    What is the area of this yard excluding the roads? Find it.

Submission attempts (in order):
A = int(input())
B = int(input())
S = (A-1)*(B-1)
print(S)

A = int(input())
B = int(input())
S = (A-1)*(B-1)
print(S)

A = int(input())
B = int(input())
S = (A-1)*(B-1)
print(S)

A = int(input())
B = int(input())
S = (A-1)*(B-1)
print(S)

A,B = map(int,input().split())
S = (A-1)*(B-1)
print(S)

A,B = map(int,input().split())
S = (A-1)*(B-1)
print(S)

A,B = map(int,input().split())
S = (A-1)*(B-1)
print(S)

A,B = map(int,input().split())
S = (A-1)*(B-1)
print(S)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted

Accepted

Accepted

Accepted
Problem: There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)    What is the area of this yard excluding the roads? Find it.

Submission attempts (in order):
A,B= (int(x) for x in input().split())
menseki=A*B
tate=1*A
yoko=1*B
goukei=1
nyan=menseki-(tate+yoko)+1

A,B= (int(x) for x in input().split())
menseki=A*B
tate=1*A
yoko=1*B
goukei=1
nyan=menseki-(tate+yoko)+1

A,B= (int(x) for x in input().split())
menseki=A*B
nyan=menseki-A-B+1
print("nyan")

A,B= (int(x) for x in input().split())
menseki=A*B
nyan=menseki-A-B+1
print("nyan")

A,B= (int(x) for x in input().split())
menseki=A*B
tate=1*A
yoko=1*B
goukei=1
nyan=menseki-(tate+yoko)+1

A,B= (int(x) for x in input().split())
menseki=A*B
tate=1*A
yoko=1*B
goukei=1
nyan=menseki-(tate+yoko)+1

A,B= (int(x) for x in input().split())
menseki=A*B
nyan=menseki-A-B+1
print("nyan")

A,B= (int(x) for x in input().split())
menseki=A*B
nyan=menseki-A-B+1
print("nyan")

A,B= (int(x) for x in input().split())
menseki=A*B
nyan=menseki-A-B+1
print(nyan)

A,B= (int(x) for x in input().split())
menseki=A*B
nyan=menseki-A-B+1
print(nyan)

A,B= (int(x) for x in input().split())
menseki=A*B
nyan=menseki-A-B+1
print(nyan)

A,B= (int(x) for x in input().split())
menseki=A*B
nyan=menseki-A-B+1
print(nyan)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted

Accepted

Accepted

Accepted
Problem: There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)    What is the area of this yard excluding the roads? Find it.

Submission attempts (in order):
# To Infinity
import re
s = input()
k = int(input())
ind = re.search(r'[23456789]', s)
if ind is None:
    ind = k
else:
    ind = ind.start()
if ind < k:
        print(s[ind])
else:
    print(1)


# To Infinity
import re
s = input()
k = int(input())
ind = re.search(r'[23456789]', s)
if ind is None:
    ind = k
else:
    ind = ind.start()
if ind < k:
        print(s[ind])
else:
    print(1)


# To Infinity
import re
s = input()
k = int(input())
ind = re.search(r'[23456789]', s)
if ind is None:
    ind = k
else:
    ind = ind.start()
if ind < k:
        print(s[ind])
else:
    print(1)


# To Infinity
import re
s = input()
k = int(input())
ind = re.search(r'[23456789]', s)
if ind is None:
    ind = k
else:
    ind = ind.start()
if ind < k:
        print(s[ind])
else:
    print(1)



a, b = map(int, input().split())
print(a * b - a - b + 1)



a, b = map(int, input().split())
print(a * b - a - b + 1)



a, b = map(int, input().split())
print(a * b - a - b + 1)



a, b = map(int, input().split())
print(a * b - a - b + 1)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted

Accepted

Accepted

Accepted
Problem: There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)    What is the area of this yard excluding the roads? Find it.

Submission attempts (in order):
a = int(input())
b = int(input())

ans = (a - 1) * (b - 1)
print(ans)


a = int(input())
b = int(input())

ans = (a - 1) * (b - 1)
print(ans)


A = int(input())
B = int(input())

print((A - 1) * (B - 1))


A = int(input())
B = int(input())

print((A - 1) * (B - 1))


A = int(input())
B = int(input())
print((A - 1) * (B - 1))


A = int(input())
B = int(input())
print((A - 1) * (B - 1))


a = int(input())
b = int(input())

ans = (a - 1) * (b - 1)
print(ans)


a = int(input())
b = int(input())

ans = (a - 1) * (b - 1)
print(ans)


A = int(input())
B = int(input())

print((A - 1) * (B - 1))


A = int(input())
B = int(input())

print((A - 1) * (B - 1))


A = int(input())
B = int(input())
print((A - 1) * (B - 1))


A = int(input())
B = int(input())
print((A - 1) * (B - 1))


a, b = map(int, input().split())

ans = (a - 1) * (b - 1)
print(ans)


a, b = map(int, input().split())

ans = (a - 1) * (b - 1)
print(ans)


a, b = map(int, input().split())

ans = (a - 1) * (b - 1)
print(ans)


a, b = map(int, input().split())

ans = (a - 1) * (b - 1)
print(ans)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted

Accepted

Accepted

Accepted
Problem: There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)    What is the area of this yard excluding the roads? Find it.

Submission attempts (in order):
A,B=map(int,input().split())
print((A-1)*(B-1)))


A,B=map(int,input().split())
print((A-1)*(B-1)))


A,B=map(int,input().split())
print((A-1)*(B-1)))


A,B=map(int,input().split())
print((A-1)*(B-1)))


A,B=map(int,input().split())
print((A-1)*(B-1))

A,B=map(int,input().split())
print((A-1)*(B-1))

A,B=map(int,input().split())
print((A-1)*(B-1))

A,B=map(int,input().split())
print((A-1)*(B-1))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted

Accepted

Accepted

Accepted
Problem: There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)    What is the area of this yard excluding the roads? Find it.

Submission attempts (in order):
S = input()
K = int(input())

p = 0
for i in range(len(S)) :
	if (S[i] != "1") :
		print(S[i])
		p = 1
		break
	
if (p == 0) :
	print("1")

S = input()
K = int(input())

p = 0
for i in range(len(S)) :
	if (S[i] != "1") :
		print(S[i])
		p = 1
		break
	
if (p == 0) :
	print("1")

S = input()
K = int(input())

p = 0
for i in range(len(S)) :
	if (S[i] != "1") :
		print(S[i])
		p = 1
		break
	
if (p == 0) :
	print("1")

S = input()
K = int(input())

p = 0
for i in range(len(S)) :
	if (S[i] != "1") :
		print(S[i])
		p = 1
		break
	
if (p == 0) :
	print("1")

read_line = [int(i) for i in input().split()]
A = read_line[0]
B = read_line[1]

print(A*B-A-B+1)


read_line = [int(i) for i in input().split()]
A = read_line[0]
B = read_line[1]

print(A*B-A-B+1)


read_line = [int(i) for i in input().split()]
A = read_line[0]
B = read_line[1]

print(A*B-A-B+1)


read_line = [int(i) for i in input().split()]
A = read_line[0]
B = read_line[1]

print(A*B-A-B+1)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted

Accepted

Accepted

Accepted
Problem: There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)    What is the area of this yard excluding the roads? Find it.

Submission attempts (in order):
source = input().split()
A,B = int(source[0]), int(source[1])
print(A*B-(A+B))

source = input().split()
A,B = int(source[0]), int(source[1])
print(A*B-(A+B))

source = input().split()
A,B = int(source[0]), int(source[1])
print(A*B-(A+B))

source = input().split()
A,B = int(source[0]), int(source[1])
print(A*B-(A+B))

source = input().split()
A, B = int(source[0]), int(source[1])
print(A * B - (A + B - 1))

source = input().split()
A, B = int(source[0]), int(source[1])
print(A * B - (A + B - 1))

source = input().split()
A, B = int(source[0]), int(source[1])
print(A * B - (A + B - 1))

source = input().split()
A, B = int(source[0]), int(source[1])
print(A * B - (A + B - 1))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted

Accepted

Accepted

Accepted
Problem: 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)?

Submission attempts (in order):
import sys


def solve(n):
    listc = []
    for i in range(1,201):
        lista = []
        for j in range(1,201):
            if i%j == 0:
                lista.append(j)
        if len(lista) >= 8 and lista[-1] %2 != 0:
            listc.append(lista[-1])
    
    for i in range(len(listc)):
        if n < listc[i]:
            return 0
        elif n >= listc[-(i+1)]:
            return len(listc)-i


def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
if __name__ == '__main__':
    main()

import sys

lines='''105
'''
sys.stdin = io.StringIO(lines)


def solve(n):
    yakusuu_array=[] 
    for x in range(1,n+1): 
        if n%x == 0: 
            yakusuu_array.append(x) 
    a=len(yakusuu_array)
    
    if a >= 8 and n%2 != 0 and 1 <= n and n <=200:
        return 1 
    else: 
        return 0


def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
if __name__ == '__main__':
    main()

import sys


def solve(n):
    listc = []
    for i in range(1,201):
        lista = []
        for j in range(1,201):
            if i%j == 0:
                lista.append(j)
        if len(lista) >= 8 and lista[-1] %2 != 0:
            listc.append(lista[-1])
    
    for i in range(len(listc)):
        if n < listc[0]:
            return 0
        elif n >= listc[-(i+1)]:
            return len(listc)-i


def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
if __name__ == '__main__':
    main()

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
def hantei(n):
    root_n = int(n**0.5 +0.5)
    
    if root_n**2 == n:
        return 0
    
    total = 0
    for i in range(1,root_n):
        if n % i == 0:
            total += 2
            
    return total
    
n = int(input())

total = 0
for i in range(1,n+1,2):
    if hantei(i) == 8:
        print(i)
        total += 1

print(total)

def hantei(n):
    root_n = int(n**0.5 +0.5)
    
    if root_n**2 == n:
        return 0
    
    total = 0
    for i in range(1,root_n):
        if n % i == 0:
            total += 2
            
    return total
    
n = int(input())

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

print(total)
    

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
n=int(input())
count=0
ans=0
for j in range(1,n+1,2):
  count=0
  for i in range(1,int(j**0.5)):
    if j%i==0 and j**0.5)==i:
      count+=1
    elif j%i==0 and j**0.5!=i:
      count+=2
  if count==8:
    ans+=1
print(ans)

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



Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())



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 len(table)
  
i = 1
answer = 0
while i < N:
  if divisor(i) == 8:
    answer += 1
  i += 2
print(answer)
  

N = int(input())



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 len(table)
  
i = 1
answer = 0
while i <= N:
  if divisor(i) == 8:
    answer += 1
  i += 2
print(answer)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
x=2
try:
    print("10//x={}".format(10//x))
    print("try節おわりやよ～")
except TypeError:
    print("Type Errorやよ～")
else:
    
    print("Errorなかったやよ～おめでとやよ～")
finally:
    
    print("おわりやよ～")

n=int(input())
import math
ans=0
def yakusu(n):
  ans_local=set()
  for i in range(1,int(math.sqrt(n))+1):
    if n%i==0:
      ans_local = ans_local | set([i,n//i]) 
  return list(ans_local)  
for i in range(1,n+1,2):
    if len(yakusu(i))==8:
        ans+=1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):

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



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

    if eight == 8:
        ans += 1

print(ans)
    

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())
ans = 0
for i in range(1,n + 1):
  if n % 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)

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)

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())
ans = 0
for num in range(1, n):
    if num%2 == 1:
        continue
    ls = []
    for i in range(1, num+1):
        if num%i == 0:
            ls.append(i)
    if len(ls) == 8:
        ans += 1
print(ans)

n = int(input())
ans = 0
for num in range(1, n):
    if num%2 == 1:
        continue
    ls = []
    for i in range(num+1):
        if num%i == 0:
            ls.append(i)
    if len(ls) == 8:
        ans += 1
print(ans)

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

n = int(input())
ans = 0
for num in range(1, n+1):
    if num%2 == 1:
        continue
    ls = []
    for i in range(1, num+1):
        if num%i == 0:
            ls.append(i)
    if len(ls) == 8:
        ans += 1
print(ans)

n = int(input())
ans = 0
for num in range(1, n+1):
    if num%2 == 0:
        continue
    ls = []
    for i in range(1, num+1):
        if num%i == 0:
            ls.append(i)
    if len(ls) == 8:
        ans += 1
print(ans)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
n=int(input())
x=0
for i in range(1,n+1,2):
  c=0
  for j in range(1,n//2+1):
    if(i%j==0):c+=1
  if(c==8):x+=1
print(x)

n=int(input())
x=0
for i in range(1,n+1,2):
  c=0
  for j in range(1,n//2+1):
    if(i%j==0):c+=1
  if(c==7):x+=1
print(x)


Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 09:15:46 2020

@author: black
"""
def check(x):
    div = [1]
    for j in range(1, x):
        if (x)%(j+1) == 0:
            div.extend([j+1])
            if (i+1)%(j+1) == 0:
                div.extend([j+1])
    return len(div)




N = int(input())
ans = []

for x in range(1, N+1):
    if x%2 == 1:
        if check(x) == 8:
            ans.extend([x])


print(len(ans))

# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 09:15:46 2020

@author: black
"""
def check(x):
    div = [1]
    for j in range(1, x):
        if (x)%(j+1) == 0:
            div.extend([j+1])
    return len(div)




N = int(input())
ans = []

for x in range(1, N+1):
    if x%2 == 1:
        if check(x) == 8:
            ans.extend([x])


print(len(ans))

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):


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)



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):
        if (ps[i]**3)*ps[j] <= N or ps[i]*(ps[j]**3) <= N:
            ans += 1
        for k in range(j+1, pl):
            if ps[i]*ps[j]*ps[k] <= N:
                ans += 1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
n=int(input())
ans=0
for i in range(1,n+1):
    c=0
    for j in range(1,i+1):
        if i%j==0 and i%2==1:
            c+=1
    if c==8:
        ans+=1
        print(i)
print(ans)


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


Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
n = 200
cnt = [0 for _ in range(n+1)]
for i in range(1, n+1):
  for j in range(i, n+1, i):
    cnt[j] += 1
print(len([i for i in range(1,n+1, 2) if cnt[i]==8]))

n = int(input())
cnt = [0 for _ in range(n+1)]
for i in range(1, n+1):
  for j in range(i, n+1, i):
    cnt[j] += 1
print(len([i for i in range(1,n+1, 2) if cnt[i]==8]))

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
from math import sqrt
N = int(input())
ans = 0
for i in range(7, N+1):
  if i%2==0:
    continue
  c = 0
  for j in range(1, int(sqrt(i))+1):
    if i%j==0:
      if i%j==j:
        c+=1
      else:
        c+=2
  if c==8:
    ans += 1
    print(i)
print(ans)

from math import sqrt
N = int(input())
ans = 0
for i in range(7, N+1):
  if i%2==0:
    continue
  c = 0
  for j in range(1, int(sqrt(i))+1):
    if i%j==0:
      c+=2
  if c==8:
    ans += 1
    print(i)
print(ans)

from math import sqrt
N = int(input())
ans = 0
for i in range(7, N+1):
  if i%2==0:
    continue
  c = 0
  for j in range(1, int(sqrt(i))+1):
    if i%j==0:
      c+=2
  if c==8:
    ans += 1
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
if N<=104:
    print(0)
elif N<=134:
    print(1)
elif N<=164:
    print(2)
elif N<=188:
    print(3)
else:
    print(4)

N = int(input())
if N<=104:
    print(0)
elif N<=134:
    print(1)
elif N<=164:
    print(2)
elif N<=188:
    print(3)
elif N<=194:
    print(4)
else:
    print(5)

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())
count = 0

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

print(count)

n = int(input())
count = 0

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

print(count)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N=input()

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

answer=0
count=0

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

print(answer)

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

N=input()

answer=0
count=0

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

print(answer)

N = int(input())

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
N=int(input())

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

print(ans)

N=int(input())

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

print(ans)

N=int(input())

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

print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
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)

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())+1,2):
    if ABC106C(i)==8:
        a += 1
print(a)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
import numpy as np
from sys import stdinans=0
c=0
N = int(input().rstrip())
for i in range(N):
  c=0
  i+=1
  if i%2==1:
    for j in range(i):
      j+=1
      if i%j==0:
        c+=1
  if c==8:
    ans+=1

print(ans)

import numpy as np
from sys import stdin
ans=0
c=0
N = int(input().rstrip())
for i in range(N):
  c=0
  i+=1
  if i%2==1:
    for j in range(i):
      j+=1
      if i%j==0:
        c+=1
  if c==8:
    ans+=1

print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
hg
n = int(input())

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


yandy
N = int(input())

count = [0] * 201
count[105] = 1
for i in range(105, 201):
    if i % 2 == 1:
        num = 0
        for n in range(1, i+1):
            if i % n == 0:
                num += 1
        if num == 8:
            count[i] = count[i-1]+1
        else:
            count[i] = count[i-1]
    else:
        count[i] = count[i-1]

print(count[N])


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

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

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
import collections

N = int(input())
count = 0

for k in range(1,N+1):
    
    num = []
    n = k
    if(n % 2 == 0):
        continue

    for i in range(2,k+1):
        if n % i == 0:
            n = int(n // i)
            num.append(i)


    num_counter = collections.Counter(num)
    print(num_counter)
    ans = 1
    for value in num_counter.values():
        ans *= value+1

    if(ans == 8):
        count += 1



print(count)

import collections

N = int(input())
count = 0

for k in range(1,N+1):
    
    num = []
    n = k
    if(n % 2 == 0):
        continue

    for i in range(2,k+1):
        if n % i == 0:
            n = int(n // i)
            num.append(i)


    num_counter = collections.Counter(num)
    ans = 1
    for value in num_counter.values():
        ans *= value+1

    if(ans == 8):
        count += 1



print(count)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

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

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)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
# ABC106B - 105
n = int(input())
odd = []
odd_divs = []

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

# ABC106B - 105
def divisors(x: int) -> set:
    """
    Compute divisors of a number.
    
    Args: x (int): an integer to be evaluated.
    Returns: divs (set): set of divisors
    """
    divs = set()
    for i in range(1, int(x ** 0.5) + 1):
        if x % i == 0:
            divs.add(i), divs.add(x // i)
    return divs


def main():
    N = int(input())
    ans = sum(len(divisors(i)) == 8 for i in range(1, N + 1, 2))
    print(ans)


if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input().strip())

c = 0
for n in range(1, N+1):
  d = 0
  for i in range(1, n+1):
    if i * i > n:
      break
    if n % i == 0:
      d += 1
      if d >= 9:
        break
  if d == 8:
    c += 1

print(c)

N = int(input().strip())

c = 0
for n in range(1, N+1, 2):
  d = 0
  for i in range(1, n+1):
    if i * i > n:
      break
    if n % i == 0:
      d += 2
      if d >= 9:
        break
  if d == 8:
    c += 1

print(c)


Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
N = int(input())
ans = 0
for n in range(1, N+1):
  yakusuu = 0
  for i in range(1, n+1):
    if n%i==0:
      yakusuu+=1
  if yakusuu==8:
    ans += 1
print(ans)

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

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
if __name__ == '__main__':
    
    N = int(input())
    n = 0
    for i in range(N):
        k = 0
        for j in range(int(i/2)):
            if i % j == 0:
                k += 1
            if k > 8:
                break
        if k == 8:
            n += 1
    print(n)

if __name__ == '__main__':
    
    N = int(input())
    n = 0
    for i in range(3,N+1,2):
        k = 1
        for j in range(2,i+1):
            if i % j == 0:
                k += 1
            if k > 8:
                break
        if k == 8:
            n += 1
    print(n)

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
N=int(input())
ans=0
for i in range(N+1):
  count=0
  for j in range(i+1):
    if i%j==0:
      count+=1
  if i%2==1 and count==8:
    ans+=1
print(ans)

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


Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
## 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())




def yakusuu(n):
    
    l = []
    border = int(math.sqrt(n))
    
    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)

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




def yakusuu(n):
    
    l = []
    border = int(math.sqrt(n))
    
    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)

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
def f(n):
    if n == 1:
        return 1
    ans = set()
    div = 3
    while n > 1:
        if n % div == 0:
            n //= div
            ans.add(div)
        else:
            div += 2
    return 2**len(ans)


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


def f(n):
    if n == 1:
        return 1
    divs = {}
    div = 3
    while n > 1:
        if n % div == 0:
            n //= div
            if div in divs:
                divs[div] += 1
            else:
                divs[div] = 1
        else:
            div += 2
    ans = 1
    for div in divs.values():
        ans *= div + 1
    return ans


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


Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
n = int(input())
result = 0
for i in range(2,n+1):
  total = 0
  for j in range(i):
    if (i%j == 0):
      tatal += 1
  if(total == 8):
    result += 1
print(result)

n = int(input())
result = 0
for i in range(1,n+1,2):
  total = 0
  for j in range(1,i+1):
    if (i%j == 0):
      total += 1
  if(total == 8):
    result += 1
    #print(i,j)
print(result)


Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
print(5)

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

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
ans = [105,135,165,189]
n = input()
if n < 105:
  print(0)
elif n < 135:
  print(1)
elif n < 165:
  print(2)
elif n < 189:
  print(3)
else:
  print(4)

ans = [105,135,165,189,195]
n = 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)

ans = [105,135,165,189]
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)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
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:
        print(i)
        ans += 1
print(ans)



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)



Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
def yakusu(x):
    A=[]
    for i in range(1,x+1):
        if x%i==0:
            A.append(i)
    return(len(A))
    
n=int(input())
ans=0

for j in range(1,n+1):
    if yakusu(n)==8:
        ans+=1
print(ans)


def yakusu(x):
    A=[]
    for i in range(1,x+1):
        if x%i==0:
            A.append()
    return(len(A))
    
n=int(input())

print(yakusu(n))


def yakusu(x):
    A=[]
    for i in range(1,x+1):
        if x%i==0:
            A.append(i)
    return(len(A))
    
n=int(input())
ans=0

for j in range(1,n+1):
    if yakusu(j)==8:
        ans+=1
print(ans)

def yakusu(x):
    A=[]
    for i in range(1,x+1):
        if x%i==0:
            A.append(i)
    return(len(A))
    
n=int(input())
ans=0

for j in range(1,n+1,2):
    if yakusu(j)==8:
        ans+=1
print(ans)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
# -*- coding: utf-8 -*-

def main():

    N = int(input())

    ans = 0
    count = 0

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


if __name__ == "__main__":
    main()

# -*- coding: utf-8 -*-

def main():

    N = int(input())

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


if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Accepted
Problem: 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)?

Submission attempts (in order):
def solve():
    N = int(input())
    
    c = 0
    for i in range(1, N+1, 2):
        f = factorize(i)
        l = []
        for j in f:
            l.append(j)
            l.append(N // j)
        l.append(N)
        l.append(1)
        s = len(set(l))
        if s == 8:
            c += 1

    return c

print(solve())


def solve():
    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

    return ans

print(solve())

Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
from fractions import gcd
from functools import reduce
N = int(input())
a = list(map(int, input().split()))

list_ans = []

for i in range(N):
    remove_a = a.pop(0)
    #print("a is",a)
    ans = reduce(gcd, a)
    list_ans.append(ans)
    a.append(remove_a)
    #print("fix a is",a)

print(max(list_ans))

n = int(input())

div_count = 0
sum = 0

for i in range(3,n+1,2):
    a = i
    j = 2
    div_count = 0
    while(j <= a):
        #print("a is",a)
        #print("j is",j)
        if a % j == 0:
            div_count += 1
            a //= j
            j += 1
        else:
            j += 1
    if div_count == 3:
        sum += 1

print(sum)



Verdicts: Runtime Error

Accepted
Problem: 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)?

Submission attempts (in order):
n=int(input())
m=int(n**0.5)+1
con_num=0
for i in range(m):
  if n%i==0:
    con_num+=1
if con_num==8 and n%2==1:
  print("1")
else:
  print("0")


#include<algorithm>

#include <cmath>
#include<string>
#define REP(i,n) for(int i=0;i<int (n);i++)
using namespace std;

int main(){
    int n;
    int ans=1;
    cin>>n;
    if (n<105){
        cout<<0<<endl;
        return 0;
    }
    for (int i=106;i<=n;i++){
        int cnt=0;
        for (int j=1;j<=i;j++){
            
            if (i %j ==0){
                cnt++;
            } 
        }
        if (cnt==8) ans++;
    }
    cout<<ans<<endl; 
    
    return 0;
}

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


Verdicts: Runtime Error

Runtime Error

Accepted