mirror of
https://bitbucket.org/Mattrixwv/projecteulerrust.git
synced 2025-12-06 17:43:58 -05:00
Added times to existing problems
This commit is contained in:
@@ -51,5 +51,6 @@ pub fn solve() -> Answer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Results:
|
/* Results:
|
||||||
|
The sum of all numbers < 1000 is 233168
|
||||||
|
It took 1.000 microseconds to solve this problem
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -49,5 +49,6 @@ pub fn solve() -> Answer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Results:
|
/* Results:
|
||||||
|
The sum of all even fibonacci numbers <= 3999999 is 4613732
|
||||||
|
It took 5.100 microseconds to solve this problem
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -51,5 +51,6 @@ pub fn solve() -> Answer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Results:
|
/* Results:
|
||||||
|
The largest factor of the number 600851475143 is 6857
|
||||||
|
It took 1.254 seconds to solve this problem
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -67,3 +67,8 @@ pub fn solve() -> Answer{
|
|||||||
//Return the results
|
//Return the results
|
||||||
return Answer::new(format!("The largest palindrome is {}", palindromes[palindromes.len() - 1]), timer.getString());
|
return Answer::new(format!("The largest palindrome is {}", palindromes[palindromes.len() - 1]), timer.getString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Results:
|
||||||
|
The largest palindrome is 906609
|
||||||
|
It took 109.264 milliseconds to solve this problem
|
||||||
|
*/
|
||||||
|
|||||||
@@ -61,3 +61,8 @@ pub fn solve() -> Answer{
|
|||||||
//Save the results
|
//Save the results
|
||||||
return Answer::new(format!("The smallest positive number evenly divisibly by all number 1-20 is {}", currentNum), timer.getString());
|
return Answer::new(format!("The smallest positive number evenly divisibly by all number 1-20 is {}", currentNum), timer.getString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Results:
|
||||||
|
The smallest positive number evenly divisibly by all number 1-20 is 232792560
|
||||||
|
It took 2.524 seconds to solve this problem
|
||||||
|
*/
|
||||||
|
|||||||
@@ -57,3 +57,8 @@ pub fn solve() -> Answer{
|
|||||||
//Save the results
|
//Save the results
|
||||||
return Answer::new(format!("The difference between the sum of the squares and the square of the sum of all numbers from 1-100 is {}\n", (sumOfSquares - squareOfSum).abs()), timer.getString());
|
return Answer::new(format!("The difference between the sum of the squares and the square of the sum of all numbers from 1-100 is {}\n", (sumOfSquares - squareOfSum).abs()), timer.getString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Results:
|
||||||
|
The difference between the sum of the squares and the square of the sum of all numbers from 1-100 is 24174150
|
||||||
|
It took 0.000 nanoseconds to solve this problem
|
||||||
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user