|
|
вернуться в форумTime limit exceeded Послано Daniil 23 окт 2015 01:20 Подскажите, как сократить время работы программы? [code deleted] Edited by moderator 19.11.2019 23:42 Re: Time limit exceeded 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. |
|
|