Home STD Contest Notification Clarification Problems Ranklist Status Print Sign Out

Contest Clarifications

Problem 1002 : 为什么总超时
为什么总超时
[code]
#include "iostream.h"
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
int j,a,b=1;
cin>>a;
if(a%2==0)
{
for(j=2;j<=a/2;j+2)
{
if(a%j==0)
b+=j;
}
}
else
{
for(j=3;j<=a/2;j+2)
{
if(a%j==0)
b+=j;
}
}
cout<<b<<endl;
}
}
[/code]
wangyd at 2007-04-09 19:22:56

 

Post a new reply

Title: