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.