#include <bits/stdc++.h>
using namespace std;
long long n,m,sum[10000000 + 5],ans;
int main()
{
cin>>n>>m;
for(int i = 2; i <= 100000;i ++)
{
for(int j = i + i; j <= 100000 ;j +=i)
{
sum[j]+=i;
}
}sum[1] = 1;
for(int i = n;i <= m ;i ++)
{
ans+=abs(i - (sum[i] + 1));
}cout<<ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
1144 KB |
Output is correct |
2 |
Correct |
6 ms |
1144 KB |
Output is correct |
3 |
Incorrect |
6 ms |
1176 KB |
Output isn't correct |
4 |
Incorrect |
6 ms |
1176 KB |
Output isn't correct |
5 |
Incorrect |
36 ms |
1360 KB |
Output isn't correct |
6 |
Incorrect |
40 ms |
1380 KB |
Output isn't correct |
7 |
Incorrect |
35 ms |
1440 KB |
Output isn't correct |
8 |
Incorrect |
14 ms |
1440 KB |
Output isn't correct |