hello
I think the answer for problem https://projecteuler.net/problem=12" is wrong.
if you solve the problem with this way:
solution 1
python
counter = 2
for i in range(2, int(n / 4) + 1):
counter += 2
The answer is different with:
solution 2
python
counter = 2
for i in range(2, int(n**0.5) + 1):
counter += 2
The obtained result (solution 1) differs from the accepted answer (solution 2).
The answer should be resulted from solution 1. because it's valid for all conditions and smaller than the accepted one(The problem wants the smallest one).
Report a wrong answer
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
-
DJohn
- Posts: 90
- Joined: Sat Oct 11, 2008 12:24 pm
Re: Report a wrong answer
The big red box at the top of the page says very clearly
Problem 12 is 23 years old, and has been solved by over 240,000 people. If the accepted answer was wrong, it's very likely that at least one of those people would have noticed by now. It's far more likely that you've made some mistake.
And indeed, you have. The code you posted is incomplete, but I think I can work out what the rest should be. You're making an assumption there that I can't think of any justification for - not surprisingly, as it's getting the wrong result.
This is not the place to post code.In particular don't post any code fragments or results.
Problem 12 is 23 years old, and has been solved by over 240,000 people. If the accepted answer was wrong, it's very likely that at least one of those people would have noticed by now. It's far more likely that you've made some mistake.
And indeed, you have. The code you posted is incomplete, but I think I can work out what the rest should be. You're making an assumption there that I can't think of any justification for - not surprisingly, as it's getting the wrong result.