|
|
back to boardHint Calculates sum of divisors. O(lim * log(lim)). for(int i = 2; i <= lim; ++i){ ++s[i]; for(int j = i + i; j <= lim; j += i) s[j] += i; } Re: Hint Maybe I don't understand it clear, but I think it will get TL. Difficult of this algorithm = O(n^2) Re: Hint Posted by Noob 17 Jul 2016 18:10 No, it's O(n log n). Learn some math. Re: Hint Posted by Egor 20 Nov 2016 01:52 |
|
|