An open API service indexing awesome lists of open source software.

https://github.com/montyanderson/euler

C++ solutions for Project Euler problems.
https://github.com/montyanderson/euler

Last synced: 3 months ago
JSON representation

C++ solutions for Project Euler problems.

Awesome Lists containing this project

README

        

# euler

C++ solutions for [Project Euler](https://projecteuler.net/problems) problems.

![Project Euler Badge](https://projecteuler.net/profile/montyanderson.png)

## Execution

All solutions have been tested on Ubuntu 15.04 (64-bit), with g++ 4.9.2.

**Note: Problems 16+ require the [ttmath](http://www.ttmath.org/) library.**

``` bash
g++ "001 - Multiples of 3 and 5.cpp" && ./a.out
```

## Benchmarks

``` bash
$ ./benchmark.sh
001 - Multiples of 3 and 5.cpp
233168

real 0m0.001s
user 0m0.000s
sys 0m0.000s

002 - Even Fibonacci numbers.cpp
4613732

real 0m0.001s
user 0m0.000s
sys 0m0.000s

003 - Largest prime factor.cpp
6857

real 0m0.007s
user 0m0.004s
sys 0m0.000s

004 - Largest palindrome product.cpp
906609

real 0m0.024s
user 0m0.020s
sys 0m0.000s

005 - Smallest multiple.cpp
232792560

real 0m0.466s
user 0m0.464s
sys 0m0.000s

006 - Sum square difference.cpp
25164150

real 0m0.001s
user 0m0.000s
sys 0m0.000s

007 - 10001st prime.cpp
104743

real 0m0.009s
user 0m0.008s
sys 0m0.000s

008 - Largest product in a series.cpp
23514624000

real 0m0.001s
user 0m0.000s
sys 0m0.000s

009 - Special Pythagorean triplet.cpp
31875000

real 0m0.093s
user 0m0.092s
sys 0m0.000s

010 - Summation of primes.cpp
142913828922

real 0m0.485s
user 0m0.484s
sys 0m0.000s

012 - Highly divisible triangular number.cpp
76576500

real 0m0.316s
user 0m0.316s
sys 0m0.000s

014 - Longest Collatz sequence.cpp
837799

real 0m0.496s
user 0m0.492s
sys 0m0.000s

016 - Power digit sum.cpp
1366

real 0m0.004s
user 0m0.000s
sys 0m0.000s

```