Skip to content
C++ solutions for more than 300 Project Euler problems
C++
Branch: master
Clone or download
Latest commit b426763 Dec 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
euler-0001.cpp created GitHub mirror Dec 12, 2019
euler-0002.cpp created GitHub mirror Dec 12, 2019
euler-0003.cpp created GitHub mirror Dec 12, 2019
euler-0004.cpp created GitHub mirror Dec 12, 2019
euler-0005.cpp created GitHub mirror Dec 12, 2019
euler-0006.cpp created GitHub mirror Dec 12, 2019
euler-0007.cpp
euler-0008.cpp created GitHub mirror Dec 12, 2019
euler-0009.cpp created GitHub mirror Dec 12, 2019
euler-0010.cpp created GitHub mirror Dec 12, 2019
euler-0011.cpp
euler-0012.cpp created GitHub mirror Dec 12, 2019
euler-0013.cpp
euler-0014.cpp created GitHub mirror Dec 12, 2019
euler-0015.cpp created GitHub mirror Dec 12, 2019
euler-0016.cpp
euler-0017.cpp created GitHub mirror Dec 12, 2019
euler-0018.cpp created GitHub mirror Dec 12, 2019
euler-0019.cpp created GitHub mirror Dec 12, 2019
euler-0020.cpp created GitHub mirror Dec 12, 2019
euler-0021.cpp created GitHub mirror Dec 12, 2019
euler-0022.cpp created GitHub mirror Dec 12, 2019
euler-0023.cpp
euler-0024.cpp created GitHub mirror Dec 12, 2019
euler-0025.cpp created GitHub mirror Dec 12, 2019
euler-0026.cpp
euler-0027.cpp created GitHub mirror Dec 12, 2019
euler-0028.cpp created GitHub mirror Dec 12, 2019
euler-0029.cpp
euler-0030.cpp created GitHub mirror Dec 12, 2019
euler-0031.cpp
euler-0032.cpp
euler-0033.cpp
euler-0034.cpp
euler-0035.cpp created GitHub mirror Dec 12, 2019
euler-0036.cpp created GitHub mirror Dec 12, 2019
euler-0037.cpp created GitHub mirror Dec 12, 2019
euler-0038.cpp created GitHub mirror Dec 12, 2019
euler-0039.cpp created GitHub mirror Dec 12, 2019
euler-0040.cpp created GitHub mirror Dec 12, 2019
euler-0041.cpp
euler-0042.cpp created GitHub mirror Dec 12, 2019
euler-0043.cpp created GitHub mirror Dec 12, 2019
euler-0044.cpp
euler-0045.cpp created GitHub mirror Dec 12, 2019
euler-0046.cpp
euler-0047.cpp created GitHub mirror Dec 12, 2019
euler-0048.cpp created GitHub mirror Dec 12, 2019
euler-0049.cpp
euler-0050.cpp created GitHub mirror Dec 12, 2019
euler-0051.cpp created GitHub mirror Dec 12, 2019
euler-0052.cpp created GitHub mirror Dec 12, 2019
euler-0053.cpp created GitHub mirror Dec 12, 2019
euler-0054.cpp created GitHub mirror Dec 12, 2019
euler-0055.cpp created GitHub mirror Dec 12, 2019
euler-0056.cpp created GitHub mirror Dec 12, 2019
euler-0057.cpp created GitHub mirror Dec 12, 2019
euler-0058.cpp created GitHub mirror Dec 12, 2019
euler-0059.cpp
euler-0060.cpp created GitHub mirror Dec 12, 2019
euler-0061.cpp created GitHub mirror Dec 12, 2019
euler-0062.cpp created GitHub mirror Dec 12, 2019
euler-0063.cpp
euler-0064.cpp created GitHub mirror Dec 12, 2019
euler-0065.cpp created GitHub mirror Dec 12, 2019
euler-0066.cpp
euler-0067.cpp
euler-0068.cpp created GitHub mirror Dec 12, 2019
euler-0069.cpp created GitHub mirror Dec 12, 2019
euler-0070.cpp created GitHub mirror Dec 12, 2019
euler-0071.cpp created GitHub mirror Dec 12, 2019
euler-0072.cpp created GitHub mirror Dec 12, 2019
euler-0073.cpp created GitHub mirror Dec 12, 2019
euler-0074.cpp created GitHub mirror Dec 12, 2019
euler-0075.cpp created GitHub mirror Dec 12, 2019
euler-0076.cpp created GitHub mirror Dec 12, 2019
euler-0077.cpp created GitHub mirror Dec 12, 2019
euler-0078.cpp created GitHub mirror Dec 12, 2019
euler-0079.cpp
euler-0080.cpp created GitHub mirror Dec 12, 2019
euler-0081.cpp created GitHub mirror Dec 12, 2019
euler-0082.cpp
euler-0083.cpp
euler-0084.cpp created GitHub mirror Dec 12, 2019
euler-0085.cpp created GitHub mirror Dec 12, 2019
euler-0086.cpp created GitHub mirror Dec 12, 2019
euler-0087.cpp created GitHub mirror Dec 12, 2019
euler-0088.cpp created GitHub mirror Dec 12, 2019
euler-0089.cpp created GitHub mirror Dec 12, 2019
euler-0090.cpp created GitHub mirror Dec 12, 2019
euler-0091.cpp created GitHub mirror Dec 12, 2019
euler-0092.cpp
euler-0093.cpp
euler-0094.cpp
euler-0095.cpp created GitHub mirror Dec 12, 2019
euler-0096.cpp
euler-0097.cpp created GitHub mirror Dec 12, 2019
euler-0098.cpp created GitHub mirror Dec 12, 2019
euler-0099.cpp created GitHub mirror Dec 12, 2019
euler-0100.cpp created GitHub mirror Dec 12, 2019
euler-0101.cpp created GitHub mirror Dec 12, 2019
euler-0102.cpp created GitHub mirror Dec 12, 2019
euler-0103.cpp
euler-0104.cpp created GitHub mirror Dec 12, 2019
euler-0105.cpp created GitHub mirror Dec 12, 2019
euler-0106.cpp created GitHub mirror Dec 12, 2019
euler-0107.cpp created GitHub mirror Dec 12, 2019
euler-0108.cpp created GitHub mirror Dec 12, 2019
euler-0109.cpp created GitHub mirror Dec 12, 2019
euler-0110.cpp created GitHub mirror Dec 12, 2019
euler-0111.cpp
euler-0112.cpp created GitHub mirror Dec 12, 2019
euler-0113.cpp created GitHub mirror Dec 12, 2019
euler-0114.cpp
euler-0115.cpp created GitHub mirror Dec 12, 2019
euler-0116.cpp created GitHub mirror Dec 12, 2019
euler-0117.cpp created GitHub mirror Dec 12, 2019
euler-0118.cpp created GitHub mirror Dec 12, 2019
euler-0119.cpp created GitHub mirror Dec 12, 2019
euler-0120.cpp created GitHub mirror Dec 12, 2019
euler-0121.cpp created GitHub mirror Dec 12, 2019
euler-0122.cpp created GitHub mirror Dec 12, 2019
euler-0123.cpp created GitHub mirror Dec 12, 2019
euler-0124.cpp
euler-0125.cpp created GitHub mirror Dec 12, 2019
euler-0126.cpp created GitHub mirror Dec 12, 2019
euler-0127.cpp created GitHub mirror Dec 12, 2019
euler-0128.cpp created GitHub mirror Dec 12, 2019
euler-0129.cpp created GitHub mirror Dec 12, 2019
euler-0130.cpp created GitHub mirror Dec 12, 2019
euler-0131.cpp created GitHub mirror Dec 12, 2019
euler-0132.cpp
euler-0133.cpp created GitHub mirror Dec 12, 2019
euler-0134.cpp created GitHub mirror Dec 12, 2019
euler-0135.cpp created GitHub mirror Dec 12, 2019
euler-0136.cpp created GitHub mirror Dec 12, 2019
euler-0137.cpp
euler-0138.cpp created GitHub mirror Dec 12, 2019
euler-0139.cpp created GitHub mirror Dec 12, 2019
euler-0141.cpp
euler-0142.cpp created GitHub mirror Dec 12, 2019
euler-0144.cpp created GitHub mirror Dec 12, 2019
euler-0145.cpp created GitHub mirror Dec 12, 2019
euler-0146.cpp
euler-0147.cpp created GitHub mirror Dec 12, 2019
euler-0148.cpp created GitHub mirror Dec 12, 2019
euler-0149.cpp created GitHub mirror Dec 12, 2019
euler-0150.cpp created GitHub mirror Dec 12, 2019
euler-0151.cpp created GitHub mirror Dec 12, 2019
euler-0152.cpp
euler-0154.cpp created GitHub mirror Dec 12, 2019
euler-0155.cpp created GitHub mirror Dec 12, 2019
euler-0156.cpp created GitHub mirror Dec 12, 2019
euler-0158.cpp created GitHub mirror Dec 12, 2019
euler-0159.cpp
euler-0160.cpp
euler-0161.cpp created GitHub mirror Dec 12, 2019
euler-0162.cpp created GitHub mirror Dec 12, 2019
euler-0163.cpp
euler-0164.cpp
euler-0165.cpp created GitHub mirror Dec 12, 2019
euler-0166.cpp created GitHub mirror Dec 12, 2019
euler-0168.cpp created GitHub mirror Dec 12, 2019
euler-0169.cpp
euler-0170.cpp created GitHub mirror Dec 12, 2019
euler-0171.cpp
euler-0172.cpp created GitHub mirror Dec 12, 2019
euler-0173.cpp created GitHub mirror Dec 12, 2019
euler-0174.cpp created GitHub mirror Dec 12, 2019
euler-0178.cpp created GitHub mirror Dec 12, 2019
euler-0179.cpp created GitHub mirror Dec 12, 2019
euler-0181.cpp created GitHub mirror Dec 12, 2019
euler-0182.cpp created GitHub mirror Dec 12, 2019
euler-0183.cpp created GitHub mirror Dec 12, 2019
euler-0185.cpp created GitHub mirror Dec 12, 2019
euler-0186.cpp created GitHub mirror Dec 12, 2019
euler-0187.cpp created GitHub mirror Dec 12, 2019
euler-0188.cpp created GitHub mirror Dec 12, 2019
euler-0189.cpp created GitHub mirror Dec 12, 2019
euler-0190.cpp created GitHub mirror Dec 12, 2019
euler-0191.cpp created GitHub mirror Dec 12, 2019
euler-0193.cpp created GitHub mirror Dec 12, 2019
euler-0196.cpp
euler-0197.cpp created GitHub mirror Dec 12, 2019
euler-0199.cpp created GitHub mirror Dec 12, 2019
euler-0200.cpp created GitHub mirror Dec 12, 2019
euler-0201.cpp created GitHub mirror Dec 12, 2019
euler-0203.cpp created GitHub mirror Dec 12, 2019
euler-0204.cpp created GitHub mirror Dec 12, 2019
euler-0205.cpp created GitHub mirror Dec 12, 2019
euler-0206.cpp created GitHub mirror Dec 12, 2019
euler-0207.cpp created GitHub mirror Dec 12, 2019
euler-0208.cpp created GitHub mirror Dec 12, 2019
euler-0209.cpp created GitHub mirror Dec 12, 2019
euler-0211.cpp created GitHub mirror Dec 12, 2019
euler-0213.cpp created GitHub mirror Dec 12, 2019
euler-0214.cpp created GitHub mirror Dec 12, 2019
euler-0215.cpp
euler-0216.cpp created GitHub mirror Dec 12, 2019
euler-0218.cpp created GitHub mirror Dec 12, 2019
euler-0219.cpp created GitHub mirror Dec 12, 2019
euler-0222.cpp created GitHub mirror Dec 12, 2019
euler-0225.cpp created GitHub mirror Dec 12, 2019
euler-0226.cpp created GitHub mirror Dec 12, 2019
euler-0227.cpp created GitHub mirror Dec 12, 2019
euler-0229.cpp created GitHub mirror Dec 12, 2019
euler-0230.cpp created GitHub mirror Dec 12, 2019
euler-0231.cpp created GitHub mirror Dec 12, 2019
euler-0232.cpp created GitHub mirror Dec 12, 2019
euler-0234.cpp
euler-0235.cpp created GitHub mirror Dec 12, 2019
euler-0237.cpp created GitHub mirror Dec 12, 2019
euler-0239.cpp
euler-0240.cpp
euler-0243.cpp
euler-0244.cpp created GitHub mirror Dec 12, 2019
euler-0247.cpp created GitHub mirror Dec 12, 2019
euler-0248.cpp created GitHub mirror Dec 12, 2019
euler-0249.cpp created GitHub mirror Dec 12, 2019
euler-0259.cpp created GitHub mirror Dec 12, 2019
euler-0260.cpp created GitHub mirror Dec 12, 2019
euler-0265.cpp created GitHub mirror Dec 12, 2019
euler-0266.cpp
euler-0267.cpp created GitHub mirror Dec 12, 2019
euler-0268.cpp
euler-0273.cpp created GitHub mirror Dec 12, 2019
euler-0274.cpp created GitHub mirror Dec 12, 2019
euler-0277.cpp created GitHub mirror Dec 12, 2019
euler-0278.cpp created GitHub mirror Dec 12, 2019
euler-0279.cpp created GitHub mirror Dec 12, 2019
euler-0280.cpp created GitHub mirror Dec 12, 2019
euler-0284.cpp created GitHub mirror Dec 12, 2019
euler-0286.cpp created GitHub mirror Dec 12, 2019
euler-0287.cpp created GitHub mirror Dec 12, 2019
euler-0288.cpp
euler-0290.cpp created GitHub mirror Dec 12, 2019
euler-0291.cpp created GitHub mirror Dec 12, 2019
euler-0293.cpp created GitHub mirror Dec 12, 2019
euler-0297.cpp created GitHub mirror Dec 12, 2019
euler-0300.cpp
euler-0301.cpp created GitHub mirror Dec 12, 2019
euler-0303.cpp created GitHub mirror Dec 12, 2019
euler-0304.cpp created GitHub mirror Dec 12, 2019
euler-0306.cpp created GitHub mirror Dec 12, 2019
euler-0307.cpp created GitHub mirror Dec 12, 2019
euler-0308.cpp created GitHub mirror Dec 12, 2019
euler-0309.cpp created GitHub mirror Dec 12, 2019
euler-0310.cpp created GitHub mirror Dec 12, 2019
euler-0313.cpp
euler-0315.cpp created GitHub mirror Dec 12, 2019
euler-0317.cpp created GitHub mirror Dec 12, 2019
euler-0321.cpp created GitHub mirror Dec 12, 2019
euler-0323.cpp created GitHub mirror Dec 12, 2019
euler-0324.cpp created GitHub mirror Dec 12, 2019
euler-0327.cpp created GitHub mirror Dec 12, 2019
euler-0329.cpp created GitHub mirror Dec 12, 2019
euler-0333.cpp created GitHub mirror Dec 12, 2019
euler-0336.cpp created GitHub mirror Dec 12, 2019
euler-0341.cpp created GitHub mirror Dec 12, 2019
euler-0343.cpp created GitHub mirror Dec 12, 2019
euler-0345.cpp created GitHub mirror Dec 12, 2019
euler-0346.cpp
euler-0347.cpp created GitHub mirror Dec 12, 2019
euler-0348.cpp created GitHub mirror Dec 12, 2019
euler-0349.cpp created GitHub mirror Dec 12, 2019
euler-0351.cpp created GitHub mirror Dec 12, 2019
euler-0358.cpp created GitHub mirror Dec 12, 2019
euler-0359.cpp created GitHub mirror Dec 12, 2019
euler-0363.cpp created GitHub mirror Dec 12, 2019
euler-0371.cpp created GitHub mirror Dec 12, 2019
euler-0375.cpp created GitHub mirror Dec 12, 2019
euler-0381.cpp
euler-0386.cpp created GitHub mirror Dec 12, 2019
euler-0387.cpp created GitHub mirror Dec 12, 2019
euler-0393.cpp created GitHub mirror Dec 12, 2019
euler-0401.cpp
euler-0407.cpp created GitHub mirror Dec 12, 2019
euler-0411.cpp created GitHub mirror Dec 12, 2019
euler-0412.cpp
euler-0418.cpp created GitHub mirror Dec 12, 2019
euler-0425.cpp created GitHub mirror Dec 12, 2019
euler-0429.cpp created GitHub mirror Dec 12, 2019
euler-0455.cpp created GitHub mirror Dec 12, 2019
euler-0458.cpp created GitHub mirror Dec 12, 2019
euler-0473.cpp created GitHub mirror Dec 12, 2019
euler-0485.cpp created GitHub mirror Dec 12, 2019
euler-0491.cpp created GitHub mirror Dec 12, 2019
euler-0493.cpp created GitHub mirror Dec 12, 2019
euler-0500.cpp created GitHub mirror Dec 12, 2019
euler-0501.cpp created GitHub mirror Dec 12, 2019
euler-0504.cpp created GitHub mirror Dec 12, 2019
euler-0510.cpp created GitHub mirror Dec 12, 2019
euler-0516.cpp created GitHub mirror Dec 12, 2019
euler-0518.cpp created GitHub mirror Dec 12, 2019
euler-0523.cpp
euler-0539.cpp
euler-0549.cpp created GitHub mirror Dec 12, 2019
euler-0563.cpp created GitHub mirror Dec 12, 2019
euler-0565.cpp created GitHub mirror Dec 12, 2019
euler-0571.cpp created GitHub mirror Dec 12, 2019
euler-0577.cpp created GitHub mirror Dec 12, 2019
euler-0581.cpp created GitHub mirror Dec 12, 2019
euler-0587.cpp created GitHub mirror Dec 12, 2019
euler-0601.cpp created GitHub mirror Dec 12, 2019
euler-0607.cpp created GitHub mirror Dec 12, 2019
euler-0610.cpp created GitHub mirror Dec 12, 2019
euler-0611.cpp created GitHub mirror Dec 12, 2019
euler-0612.cpp created GitHub mirror Dec 12, 2019
euler-0613.cpp created GitHub mirror Dec 12, 2019
euler-0615.cpp
p011_matrix.extra.txt created GitHub mirror Dec 12, 2019
p013_numbers.extra.txt
p018_triangle.extra.txt created GitHub mirror Dec 12, 2019
p022_names.txt created GitHub mirror Dec 12, 2019
p042_words.txt created GitHub mirror Dec 12, 2019
p054_poker.txt created GitHub mirror Dec 12, 2019
p059_cipher.txt created GitHub mirror Dec 12, 2019
p067_triangle.txt created GitHub mirror Dec 12, 2019
p079_keylog.txt
p081_matrix.txt
p082_matrix.txt
p083_matrix.txt created GitHub mirror Dec 12, 2019
p089_roman.txt created GitHub mirror Dec 12, 2019
p096_sudoku.txt created GitHub mirror Dec 12, 2019
p098_words.txt created GitHub mirror Dec 12, 2019
p099_base_exp.txt created GitHub mirror Dec 12, 2019
p102_triangles.txt created GitHub mirror Dec 12, 2019
p105_sets.txt
p107_network.txt
p424_kakuro200.txt
readme.md created GitHub mirror Dec 12, 2019

readme.md

This is a mirror of my C++ solutions for about half of the Project Euler problems

You can find the code along with in-depth explanations and live demos at https://euler.stephan-brumme.com

Below is an excerpt from https://euler.stephan-brumme.com/why/ :

Why do I publish my solutions ?

Almost always the solutions for problems at Project Euler consist of two parts:

  1. finding a mathematical way to break down the problem's structure into its elements
  2. writing an efficient program for step 1

I strive to:

  • explain my choice of algorithms and data structures
  • write fully commented C++ source code that compiles without warnings and without any external libraries
  • interactive tests for most problems
  • link to relevant Wikipedia / MathWorld / OEIS pages
  • link to other solutions, especially those that are written in other programming languages

Let's not forget that it helps me, too: only if I can explain a solution to someone else then I can be sure that I truly understood it in the first place. And practicing some of the lesser used features of C++ (such as algorithms hidden inside STL, like std::next_permutation) improves my overall coding skills as well.

Sounds like a win-win situation ...

"But You Shouldn't Publish Your Solutions !"

Project Euler encourages you NOT to publish solutions.

I have a different point of view:

  • 99% of my knowledge is based on things I was taught, I saw somewhere or I stumbled across
  • and maybe 1% is "original"
  • I'm pretty sure it's not just me - it's the way how all of us gain knowledge

So it boils down to:

  • having a good teacher
  • access to well-equipped library
  • and probably most important today: your skills in working with a search engine

If someone visits my website/repository then he/she already realized that he/she can't solve that problem and is doing the right thing: ask someone. That's the only way how knowledge can be spread - all famous scientists wrote books. Leonhard Euler was one of the most productive mathematicians and he published 866 papers/books/etc. He shared his knowledge. And a substantial number of my solutions is based on some of his formulas, I only solved them because I could look up his works.

Admittedly, there is no use in publishing lists of the results to Project Euler problems. In my opinion, these numbers don't matter at all: noone really cares whether the result of problem 1 is 233167, 233168 or 233169. That's why you find algorithms, explanations, links, code, ..., basically everything on my website - but not the results. Because these numbers don't teach you anything.

You can’t perform that action at this time.