hi,
i m having some problem with the DIVSUM(divisor summation) program. Its giving me time limit exceeded.
Can someone please help me with the code to reduce the time of execution.
include
using namespace std;
int main()
{
int t,a,i,l,sum;
scanf("%d",&t);
while(t--)
{ scanf("%d",&a);
sum=0;
for(i=1;i<=a/2;i++)
{ if(a%i==0)
{ sum=sum+i;
}
}
printf("%d\n",sum);
}
return 0;
}