Open
Conversation
Profiling ex.
Dzhoker1
reviewed
Sep 4, 2018
| @@ -0,0 +1,34 @@ | |||
| # Алгоритм Евклида. Нахождение "Наибольшего Общего Делителя (НОД)" | |||
There was a problem hiding this comment.
На дом такую задачу я не задавал. Почему вы решили взять её. Но всё равно дочитаю до конца.
| @@ -0,0 +1,75 @@ | |||
| import math | |||
|
|
|||
| # Решето Эратосфена | |||
There was a problem hiding this comment.
Решето Эратосфена из урока. Хорошо. Но ответ про i-е простое число функция не выдаёт.
|
|
||
| # Решето Аткина | ||
|
|
||
| def Atkin(nmax): |
There was a problem hiding this comment.
Ещё одно решето. Класс. И работает. Но проблема та же. Прошу сказать мне 5-е простое число и вместо 11 получаю список [2, 3, 5].
| @@ -0,0 +1,6 @@ | |||
| Tue Sep 4 02:19:57 2018 | |||
There was a problem hiding this comment.
Представляю как у вас кипела работа ночью )))
| print(f'{time.ctime(time.time())}\n') | ||
|
|
||
| # Рекурсивная реализация алгоритма Евклида. --> GCD1 (n * e-06 = n / 10 ^ 6) | ||
| start1 = time.time() |
There was a problem hiding this comment.
Знакомый вариант для замера времени )))
|
|
||
| print(f'{time.ctime(time.time())}\n') | ||
|
|
||
| # С модулем timeit расчет времени работы алгоритма идёт очень медленно!!! |
There was a problem hiding this comment.
Ещё бы. Ведь модуль запускает алгоритм 1000000 раз.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Profiling (computer programming)