Hey everyone, I'm working on Project Euler problem 23 right now, which asks to find the sum of all numbers that can't be expressed as the sum of two abundant numbers: http://projecteuler.net/problem=23
I wrote this solution, but I'm getting 4179595 as the output instead of the expected 4179871, I'm sure it's probably a dumb error, but I can't see it. Also I was hoping someone could tell me what I could do to make it faster, since right now it takes it almost 20 seconds to run, most of it is the sort function.
I'm not sure why you're answer is incorrect. Anyway, you can get a speed boost by only checking divisors up to sqrt(n). I also used an array instead of vector in my solution, which is faster.