eolymp
bolt
Try our new interface for solving problems
Problems

Primes

published at 2/12/20, 5:43:53 pm

you should notice also 0,1

published at 6/12/20, 7:07:09 pm

В условии сказано что "2 ≤ m < n ≤ 10^7". Но в тестах есть случаи когда m < 2 как сказано выше. Было бы хорошо если исправили условие задачи.

published at 2/12/24, 6:49:39 pm

Please help me my solution is right but it gives me 0% please help what is wrong here:

def f(a, b): sade = [True] * (b + 1)

sade[0] = sade[1] = False

for i in range(2, int(b ** 0.5) + 1):
    if sade[i]:
        for j in range(i*i, b + 1, i):
            sade[j] = False

return sade[a:b + 1].count(True)

while 1: try:
a, b = map(int, input().split())

    print(f(a, b))

    print()
except:
    break