ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Форумы > Обсуждение задач > тема:


Задача "50575 - Numri i numrave prim"

Идёт турнир!

В настоящий момент идёт турнир. Некоторая информация и функции сервера недоступны до его окончания.

imesecan29.сен.2015 в 21:24:48
0-- Test 1 ---
2 10

--- Pattern ---
4

imesecan08.дек.2015 в 11:12:53
1It's faster if you check until the square root of the number.
while(divisor*divisor<=num)

You can also make faster than that.
if the number is 2, it's prime,
if it's not 2 and if the number is divisible by two, it's not prime,
otherwise start from 3 and check for only odd numbers until the square root of the numbers.


www.contester.ru