John D'Errico

1054
Rank
7
Badges
1576
Score
1 – 50 of 271

John D'ErricoreceivedQuiz Masterbadge forSolution 2931295

on 10 Sep 2020

John D'Erricosubmitted aCommenttoProblem 43642. Euclidean distance from a point to a polynomial

I'm enjoying these creative solutions.

on 4 May 2018

John D'Erricosubmitted aCommenttoProblem 1428. Find the optimal shape to bring the maximum product by a given perimeter

我更新了问题解释更多clear. I also repaired the checks for a valid solution to use a relative test, mainly valuable for one of the cases where an absolute test on the error was a poor choice.

on 26 Mar 2018

John D'Erricosubmitted aCommenttoProblem 1428. Find the optimal shape to bring the maximum product by a given perimeter

I took a look at the test cases. The 4th test has a result that is expected to be on the order of 1e40. Then it compares that to the solution returned, and tests to see if the absolute difference is less then 1e-4? eps(1e40) is roughly 1e24. So the difference between two numbers of size 1e40 will never be less than 1e-4, unless they are IDENTICAL. Far better would be to test if the relative difference is small.

on 26 Mar 2018

John D'Erricosubmitted aCommenttoProblem 1442. Volume of a Simplex

Good problem, in the sense that it disallows many of the hacks used to cook a problem.

on 22 Feb 2018

John D'Erricosubmitted aCommenttoProblem 525. Mersenne Primes

No. 2047 is not a Mersenne prime. 2047=23*89, even though it is true that 2047=2^11-1.

on 22 Feb 2018

John D'Erricosubmitted aCommenttoProblem 981. Find nearest prime number less than input number

I removed the test case where n==2, since 1 is indeed not a prime number. I also added a random test case, so the problem is not so easily cooked by knowing all the test cases.

on 22 Feb 2018

John D'Erricosubmitted aCommenttoProblem 1119. sum of non-primes

I've now fixed the problem statement to be consistent.

on 22 Feb 2018

John D'Erricosubmitted aCommenttoProblem 241. Project Euler: Problem 7, Nth prime

Sadly, I see there are too few test cases, and the problem is too easy to cook.

on 22 Feb 2018

John D'Erricosubmitted aCommenttoProblem 241. Project Euler: Problem 7, Nth prime

Aw drat. I was going to submit the n'th prime problem until I saw this.

on 22 Feb 2018

John D'Erricosubmitted aCommenttoSolution 1278460

Tabulate could probably be made to work here, but I recall that Cody does not allow toolbox functions, and tabulate lives in the stats toolbox. I'd guess the logic is that not everyone has all toolboxes, so a solution that uses some tool that others cannot use would not be fair to those others.

on 21 Feb 2018

John D'Erricosubmitted aCommenttoProblem 43564. Calculate sin(x) without sin(x)

You could at least bother to write a reference solution.

on 17 Oct 2016

John D'Erricosubmitted aCommenttoProblem 43567. i forgot to use capital I

没有提供参考解决方案。

on 17 Oct 2016

John D'Erricosubmitted aCommenttoSolution 553580

A very good reason why it would NOT work. You returned a double precision number. But a double can only store integers correctly as large as 2^53-1.

on 13 Oct 2016

John D'Erricosubmitted aCommenttoProblem 43329. Solve expression II

Note that this problem uses the word solve when it needs to say EVALUATE.

on 13 Oct 2016

John D'Erricosubmitted aCommenttoProblem 43326. Solve expression I

Note that this problem uses the word solve when it needs to say EVALUATE.

on 13 Oct 2016

John D'Erricosubmitted aCommenttoProblem 43330. Solve expression III

Note that this problem uses the word solve when it needs to say EVALUATE.

on 13 Oct 2016

1 – 50 of 271