|
|
back to boardTime limit exceeded Posted by Daniil 23 Oct 2015 01:20 Подскажите, как сократить время работы программы? [code deleted] Edited by moderator 19.11.2019 23:42 Re: Time limit exceeded Posted by nadinne 27 Oct 2015 09:15 First you should rewrite function which counts sum of divisors: for (i=2;i*i<=n;i++)..., second you shouldn't compute triviality of all numbers in [i,j]: just for numbers from j downto first prime number>=i, and of course take into account that triviality(1)=0. |
|
|