#include <bits/stdc++.h>
using namespace std;
int s[10000007];
int main()
{
int a,b;cin>>a>>b;
for(int i=1;i<=b;i++)
{
for(int j=i+i;j<=b;j+=i)
{
s[j]-=i;
}
}
int sum=0;
for(int i=a;i<=b;i++)
{
sum+=abs(i+s[i]);
}
cout<<sum;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Incorrect |
4 ms |
760 KB |
Output isn't correct |
4 |
Incorrect |
1579 ms |
39664 KB |
Output isn't correct |
5 |
Incorrect |
1690 ms |
39416 KB |
Output isn't correct |
6 |
Incorrect |
1670 ms |
39496 KB |
Output isn't correct |
7 |
Incorrect |
1473 ms |
36424 KB |
Output isn't correct |
8 |
Incorrect |
127 ms |
10232 KB |
Output isn't correct |