This is my code for divsum
#include <stdio.h>
int main()
{
int t, sum=0, x;
scanf("%d", &t);
for(int i=1;i<=t;i++) {
scanf("%d", &x);
for(int j=1;j< x;j++) {
if(x%j == 0) sum+=j;
}
printf("%d\n", sum);
sum=0;
}
return 0;
}
but it says time limit exceeded.
- Can someone tell me which part of this code is too "slow" for submition?
- Is there some way to find out for how long the code wasactually running?
Thanks