6 kyu
GCD not equal to 1
Loading description...
Mathematics
Number Theory
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Quite a nice entry level kata on performance.
That was very enjoyable, thank you!
Referee solution failing for:
gcd_neq_one(105, 593, 223092870), yields 34, but correct result is 33
Edit: Fork with a more optimal referee to approve here
Approved.
Don't forget to add the
performance
tag once you are done describing the performance constraints in the description.This comment has been hidden.
ok
Additionally, author's solution should not print to console.
Thanks for your suggestion. I have changed my solution.
I changed the testcase and now the average answer is larger. Thanks for your suggestion.
This comment has been hidden.
As an example, under the current constraint you can have
gcd_neq_one(85, 414, 223092870) == 44
. Running this 1000 times, the author solution takes 0.5s, my solution takes 1.5s, Unnamed's solution times out at 600-800 runs, the other two solutions can't even finish 1 run.So clearly some solutions will fail spectacularly for some very specific inputs, and this needs to be clarified.
Thank you so much for your corner case.
I changed the testcase so that now most of the answers for the test are above 10.