|
|
вернуться в форумHint 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 Послано Noob 17 июл 2016 18:10 No, it's O(n log n). Learn some math. Re: Hint Послано Egor 20 ноя 2016 01:52 |
|
|