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

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


Задача "Question 1"

Идёт турнир!

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

imesecan15.дек.2012 в 10:35:14
0Сообщение скрыто

imesecan15.дек.2012 в 10:37:36
1Сообщение скрыто

imesecan15.дек.2012 в 10:41:37
2
(0: CLig)
Yes

imesecan15.дек.2012 в 12:16:20
3
(4: ArditMeti)
Yes I just saw that in input tests
100000 is included.
That is the question has to say
1< a< b<= 100.000.

Thanks I will correct the question
Can you please resubmit your solution.

imesecan15.дек.2012 в 14:57:12
4Сообщение скрыто

imesecan15.дек.2012 в 17:24:05
5Сообщение скрыто

imesecan26.дек.2012 в 14:15:52
6Реплика удалена

imesecan26.дек.2012 в 23:17:02
7
(8: Erilda)
In order to check if a number is prime or not you need to check if the number is divisible by any number other than one and itself. That simply means you need to start checking if the number is divisible by: 2, 3, 4, ... (n-1). If any number divides perfectly than you can conclude that it's not prime otherwise it's prime.

But with a simple analysis you can understand that after (n/2) there is no number that can divide a number fully. That means checking 2, 3, 4, ... (n/2) will be enough.

But I told that to check if the number is prime, you don't have to check until (n-1) or (n/2); actually checking 2, 3, 4, ... sqrt(n) will be enough.

imesecan27.дек.2012 в 21:46:45
8Реплика удалена


www.contester.ru