Showing posts with label optimization. Show all posts
Showing posts with label optimization. Show all posts

Monday, December 19, 2016

Euler Zero, re-revisited

It seems I was a bit optimistic about how easy it would be to create zero-runtime solutions to Project Euler problems due to the relaxations on constexpr functions introduced in C++14.

I recently picked up a problem a colleague pointed out to me last year and as it turned out to be from Project Euler, I decided to try to create a zero-runtime version after I came up with a correct solution. It is more challenging than I expected, so I may be doing the occasional Euler Zero solution after all.

Euler Zero code and wiki are now in a GitHub repository, at https://github.com/frasnian/euler-zero. Any solutions will be linked from here, but for the most part, code will be in the repository and commentary will be in the accompanying repo wiki.

Thursday, January 22, 2015

Project Euler

I just looked at Project Euler. I've noticed the occasional question on StackOverflow with "Project Euler" in the subject, and always kind of blew them off because so many seemed to have the same questions. I just assumed (yeah, yeah, never a good idea) they were more of the annoying "help me with my homework" or "what is teh codez to fix" types of questions that sometimes flood Stack Overflow, so I pretty much ignored them. I never looked at the project-euler tag-wiki for PE, so I thought it was just some crappy development toolkit or project that attracted a lot of stupid people that all had to solve the same problem. Again. And again.

So anyway, I was talking to a former colleague the other day and he mentioned PE because he knows that meaningless programming puzzles are like Sudoku to me. It turns out that although many of the problems are pretty easy, just as many could be fairly interesting (and some seem quite difficult). Especially if your goal is for more than just writing a correct solution: what is the absolute minimum run-time cost for a correct solution to each problem?

This could be fun.