Updated problem 1 to faster solution

This commit is contained in:
2020-10-26 12:00:47 -04:00
parent 42f225b5f2
commit 609baf482b
2 changed files with 11 additions and 11 deletions

View File

@@ -38,6 +38,7 @@ private:
static uint64_t MAX_NUMBER; //The highest number to be tested
//Instance variables
uint64_t fullSum; //For the sum of all the numbers
uint64_t sumOfProgression(uint64_t multiple); //Gets the sum of the progression of the multiple
public:
//Constructor
Problem1();
@@ -51,7 +52,7 @@ public:
/* Results:
The sum of all the numbers < 1000 that are divisible by 3 or 5 is 233168
It took an average of 957.000 nanoseconds to run this problem over 100 iterations
It took an average of 50.000 nanoseconds to run this problem over 100 iterations
*/
#endif //PROBLEM1_HPP