The series, 11 + 22 + 33 + ... + 1010 = 10405071317.
Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.
analyse:
Because only the last ten digits are needed in the answer we can avoid big integers by
truncating each calculation to ten digits.
Problem48 = 9110846700 elapsed time: 18 ms. Test Passed.
Geen opmerkingen:
Een reactie posten