Skip to content

mryingster/ProjectEuler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Euler

Description

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.

This repository contains a collection of programmatic solutions to some of the problems posed by Project Euler.

Most of the solutions will be in C or Python.

Dependencies

  • math - Some solutions require the math lib.

Compiling

C, C++, and Swift based solutions can be compiled directly in emacs using the M^x compile command.

Table of Results

The following table shows solution times for the first 125 solutions in this repository. Optimized denotes that there is a solution present which is under the prescribed time limit of 1 minute.

Problem Solved Optimized Fastest Lang. C/C++ Swift Rust Python Perl Lua Bash Go
001 X X C/C++ 0:00:00.002577 0:00:00.072235 0:00:00.004969 0:00:00.027222 0:00:00.027945 0:00:00.050638 0:00:00.073166 0:00:00.003635
002 X X C/C++ 0:00:00.002356 0:00:00.023298 0:00:00.004902 0:00:00.020521 0:00:00.007557 0:00:00.019138 0:00:00.023198 0:00:00.003771
003 X X C/C++ 0:00:00.001925 0:00:00.026744 0:00:00.006951 0:00:00.029671 0:00:00.013467 0:00:00.039509 0:00:00.251004 0:00:00.003174
004 X X Go 0:00:00.032427 0:00:00.027583 0:00:00.146900 0:00:00.750084 0:00:01.437947 0:00:01.503834 0:00:07.356521 0:00:00.007654
005 X X Go 0:00:00.376034 0:00:00.951799 0:00:01.354313 0:00:00.029238 0:00:00.012380 0:00:04.541825 0:00:00.030795 0:00:00.004059
006 X X C/C++ 0:00:00.002197 0:00:00.025325 0:00:00.004833 0:00:00.042607 0:00:00.025070 0:00:00.017441 0:00:00.012275 0:00:00.002510
007 X X C/C++ 0:00:00.005728 0:00:00.057680 0:00:00.133311 0:00:00.447572 0:00:00.451335 0:00:00.098413 0:00:55.423726 0:00:00.007235
008 X X C/C++ 0:00:00.002012 0:00:00.176265 0:00:00.006031 0:00:00.076607 0:00:00.025188 0:00:00.041690 0:00:00.362007 0:00:00.003896
009 X X C/C++ 0:00:00.003888 0:00:00.035303 0:00:00.021165 0:00:00.124173 0:00:00.090358 0:00:00.075152 0:00:02.806081 0:00:00.003974
010 X X Go 0:00:00.123064 0:00:01.416638 0:00:08.137946 0:00:03.070483 0:00:24.628949 0:00:04.021126 0:03:16.035233 0:00:00.026346
011 X X C/C++ 0:00:00.003008 0:00:00.058874 0:00:00.005299 0:00:00.019406 0:00:00.011672 0:00:00.006243 0:00:13.233919
012 X X Swift 0:00:00.113077 0:00:00.048960 0:00:00.269048 0:00:00.318192 0:00:00.388215 0:00:02.464054 0:00:05.455015 0:00:00.100255
013 X X C/C++ 0:00:00.002084 0:00:00.060091 0:00:00.004011 0:00:00.011859 0:00:00.005406 0:00:00.029247
014 X X Go 0:00:00.061073 0:00:00.319065 0:00:00.211363 0:00:05.660329 0:00:02.504880 1:47:16.539037 0:00:00.043979
015 X X C/C++ 0:00:00.002318 0:00:00.024859 0:00:00.005135 0:00:00.013979 0:00:00.005071 0:00:00.186400
016 X X Go 0:00:00.008694 0:00:00.052554 0:00:00.042059 0:00:00.011291 0:00:00.171086 0:00:24.652277 0:00:00.005874
017 X X C/C++ 0:00:00.002017 0:00:00.026859 0:00:00.004012 0:00:00.015913 0:00:00.005864 0:00:00.204489 0:00:00.003155
018 X X C/C++ 0:00:00.002014 0:00:00.041671 0:00:00.004285 0:00:00.014107 0:00:00.004711 0:00:01.639173 0:00:00.004970
019 X X C/C++ 0:00:00.002999 0:00:00.030209 0:00:00.005741 0:00:00.111018 0:00:00.033773 0:00:03.144177
020 X X C/C++ 0:00:00.004544 0:00:00.232329 0:00:00.025424 0:00:00.011232 0:00:00.142714 0:08:11.548858
021 X X Rust 0:00:00.205837 0:00:00.651905 0:00:00.008174 0:00:05.411643 0:00:00.046688 0:00:08.073888
022 X X C/C++ 0:00:00.006819 0:00:00.239500 0:00:00.046507 0:00:00.033456 0:00:00.077351 0:08:38.903940
023 X X C/C++ 0:00:00.110519 0:00:11.638328 0:00:01.271637 0:00:15.273128 0:00:11.955184
024 X X C/C++ 0:00:00.083522 0:00:01.680871 0:00:00.914124 0:00:01.734758 0:00:06.048511 0:04:43.484839
025 X X Rust 0:00:00.115662 0:00:02.440728 0:00:00.005235 0:00:01.108789 0:00:00.025194 0:00:00.274685
026 X X C/C++ 0:00:00.216526 0:00:00.408809 0:00:00.407444 0:00:02.610010
027 X X C/C++ 0:00:00.091880 0:00:00.228419 0:00:00.598978 0:00:06.280078 0:00:04.490951
028 X X C/C++ 0:00:00.002220 0:00:00.038519 0:00:00.043368 0:00:00.035450 0:00:00.006434 0:00:00.090739
029 X X Python 0:00:05.373987 0:00:26.319602 0:00:07.828033 0:00:01.643259 0:00:20.779321
030 X X C/C++ 0:00:00.024765 0:00:00.166017 0:00:00.288618 0:00:00.874295 0:00:00.665773 0:02:29.625913
031 X X Rust 0:00:00.617835 0:00:00.225988 0:00:00.004423 0:00:00.560910
032 X X Python 0:00:00.479682 0:00:01.871179 0:00:00.445718 0:00:00.253120
033 X X Rust 0:00:00.022361 0:00:00.030552 0:00:00.006419 0:00:00.455147
034 X X Rust 0:00:00.178932 0:00:00.427583 0:00:00.036636 0:00:00.237060
035 X X Rust 0:00:00.349268 0:00:00.671565 0:00:00.232974 0:00:02.294596
036 X X C/C++ 0:00:00.146492 0:00:00.422807 0:00:00.176726 0:00:01.497447
037 X X C/C++ 0:00:00.118991 0:00:00.591754 0:00:00.165816 0:00:46.532001
038 X X C/C++ 0:00:00.029732 0:00:00.049483 0:00:00.030058 0:00:00.068089
039 X X C/C++ 0:00:00.032912 0:00:00.082862 0:00:00.085012 0:00:00.609893
040 X X Rust 0:00:00.063484 0:00:00.957561 0:00:00.023643 0:00:00.152899
041 X X Rust 0:00:00.018994 0:00:00.072530 0:00:00.004492 0:00:08.233059
042 X X C/C++ 0:00:00.006188 0:00:00.133689 0:00:00.016544 0:00:00.029016
043 X X Rust 0:02:14.071139 0:00:21.238753 0:00:08.457214 0:00:37.896542
044 X X C/C++ 0:00:00.100103 0:00:00.702817 0:00:00.427566 0:00:34.308859
045 X X Rust 0:00:00.021272 0:00:00.031569 0:00:00.007478 0:00:00.098505
046 X X Rust 0:00:00.257181 0:00:00.425249 0:00:00.008586 0:00:00.105180
047 X X Rust 0:00:00.307649 0:00:00.154247 0:00:00.095891 0:00:00.688371
048 X X C/C++ 0:00:00.009770 0:00:00.034622 0:00:00.029620 0:00:00.069092
049 X X C/C++ 0:00:00.202030 0:00:00.806503 0:00:00.342468 0:00:03.369969
050 X X C/C++ 0:00:00.010004 0:00:00.378786 0:00:00.364939 0:00:08.068792
051 X X Rust 0:00:00.040080 0:00:00.448396 0:00:00.029790 0:00:01.708206
052 X X Rust 0:00:00.109129 0:00:00.136925 0:00:00.107791 0:00:00.797558
053 X X Rust 0:00:00.051840 0:00:00.046386 0:00:00.017032 0:00:00.098956
054 X X C/C++ 0:00:00.004267 0:00:00.659422 0:00:00.067962 0:00:00.132235
055 X X Rust 0:00:00.082504 0:00:00.045073 0:00:00.020303 0:00:00.163180
056 X X Python 0:00:02.295887 0:00:02.527681 0:00:02.354236 0:00:00.402065
057 X X Python 0:00:00.045334 0:00:00.504260 0:00:00.233320 0:00:00.029637
058 X X Swift 0:00:06.572859 0:00:00.866983 0:00:01.266941 0:00:13.047090
059 X X C/C++ 0:00:00.033153 0:00:00.347409 0:00:00.046256 0:00:00.274777
060 X X Rust 0:00:01.592703 0:00:05.029267 0:00:01.109083 0:02:38.230711
061 X X C/C++ 0:00:00.029174 0:00:00.304144 0:00:00.102625 0:00:00.779658
062 X X Swift 0:00:00.157508 0:00:00.045889 0:00:01.083478 0:00:00.557340
063 X X C/C++ 0:00:00.022325 0:00:00.028006 0:00:00.028992 0:00:00.126408 0:00:03.127954
064 X X Rust 0:00:00.033439 0:00:00.093073 0:00:00.022687 0:00:00.328112
065 X X Rust 0:00:00.040305 0:00:00.025332 0:00:00.009013 0:00:00.053426
066 X X Python 0:00:00.071403
067 X X C/C++ 0:00:00.003266 0:00:00.123669 0:00:00.010472 0:00:00.032197
068 X X C/C++ 0:00:00.008170 0:00:00.039656 0:00:00.011731 0:00:00.075334
069 X X Rust 0:00:00.032145 0:00:00.060407 0:00:00.003919 0:00:00.040212
070 X X C/C++ 0:00:01.368274 0:00:21.015754 0:00:04.724772 0:00:21.883337
071 X X Swift 0:00:00.092790 0:00:00.054812 0:00:00.089734 0:00:18.216635
072 X X C/C++ 0:00:00.058104 0:00:00.605918 0:00:00.311707
073 X X Swift 0:00:16.214891 0:00:08.172879 0:03:20.309452 0:00:18.179356
074 X X Rust 0:00:00.919507 0:00:08.004184
075 X X C/C++ 0:00:00.833407 0:00:02.738996
076 X C/C++ 0:01:34.226529
077 X X C/C++ 0:00:00.028811
078 X X Python 0:00:22.240010
079 X X Rust 0:00:00.006821 0:00:00.071690
080 X X Python 0:00:00.056804
081 X X Rust 0:00:00.024156 0:00:00.018814
082 X X Rust 0:00:00.053518 0:00:00.015663
083 X C/C++ 3:10:30.644403
084 X X C/C++ 0:00:00.020586
085 X X Python 0:00:15.484017
086 X Rust 0:05:05.740156 0:01:57.942392
087 X X Rust 0:00:00.042930 0:00:02.475497
088 X X C/C++ 0:00:05.736287
089 X X Bash 0:00:00.116556 0:00:00.015021
090 X X C/C++ 0:00:00.028009
091 X X Python 0:00:00.162818
092 X X C/C++ 0:00:03.869686 0:03:08.477172
093 X X C/C++ 0:00:00.043686
094 X X Python 0:00:00.046959
095 X X C/C++ 0:00:00.273689
096 X X C/C++ 0:00:01.156366
097 X X C/C++ 0:00:00.071275
098 X X Python 0:00:05.051417
099 X X Rust 0:00:00.037878 0:00:00.093380
100 X X Python 0:00:00.051333
101 X X Python 0:00:00.029419
102 X X Python 0:00:00.123151
103 X X Python 0:00:34.217743
104 X X C/C++ 0:00:00.121676
105 X X Python 0:00:01.720496
106 X X Python 0:00:18.223484
107 X X Python 0:00:00.039369
108 X X C/C++ 0:00:00.061611
109 X X C/C++ 0:00:00.018329 0:00:01.540974
111
112
113 X X Python 0:00:00.028380
114
115
116
117
118 X Python 0:02:19.192877
119
120
121
122
123
124 X X C/C++ 0:00:00.370659
125 X X C/C++ 0:00:00.055929

About

Solutions for various Project Euler problems implemented in primarily C and Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published