I am trying to submit solution for the SPOJ 
DIVSUM<https://www.spoj.pl/problems/DIVSUM/>problem, but it returns the 
*time limit exceeded*. Code submitted by me is below:


#include <cstdlib>
#include <iostream>

using namespace std;

int proper_divisor(int number);
int main()
{
    int test,i,number;
    cin>>test;
    for(i=0; i<test; i++)
    {
        cin>>number;
        proper_divisor(number);
    }    
}
int proper_divisor(int number)
{
    int i,n=0;
    for(i=1; i<number-1; i++)
    {
        if(number%i==0)
        {
           n=n+i;             
        }
    }
    //cout<<n<<"\n";
}



-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/vld8Fghb1twJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to