Skip to main content

New answers tagged

1 vote

Performance Tuning to enable answer for Project Euler #566 "Cake Icing Puzzle"

your code for definition needs a lot of cycles (this makes it slow); to make it faster you need to use more efficient formulas or a different language like c or c++. If you want to use python, I ...
AsrtoMichi's user avatar
2 votes
Accepted

Clique Connect: minimum spanning tree

Your code with the example dataset has only 645 calls (that's very fast). Anyway, I improved it and added some comment. I don't think any particular gimmick are needed, such as using JIT. There are ...
AsrtoMichi's user avatar
2 votes

Count how many numbers in a range have exactly three divisors

PHP isn't my language, so I'll keep to a high-level review of the algorithm. The function names are misleading. findDivisors() doesn't find divisors, for example. ...
Toby Speight's user avatar
  • 76.8k
2 votes

Find maximum value of recursively-defined "fusc" function

Don’t Calculate values Unnecessarily For odd n > 1, F(n) = F(n/2) + F(n/2 + 1) = F(n - 1) + F(n + 1). F(0) < F(1) = F(2). This means that any odd number has a fusc value greater than or equal ...
Davislor's user avatar
  • 7,936

Top 50 recent answers are included