I was expecting something like timeout, but it turns out to be wrong answer
I tried the test numbers but all good
and I tried 1000000000, answer is 355091432 which according to comments is an answer from AC result.
So, what's wrong?
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
int LEN;
scanf("%d",&LEN);
long int unsigned num;
for(i=0;i<LEN;i++){
scanf("%ld",&num);
long int j;
long int unsigned sum=0;
for(j=1;j<=num;j++){
sum+=num%j;
}
long long unsigned int result;
result=(num*num-sum)%1000000007;
printf("%lld\n",result);
}
return 0;
}
created
last reply
- 2
replies
- 1.1k
views
- 3
users
- 1
link