#include <iostream>
#include <algorithm>
#define pozitie second
#define numar first
using namespace std;
int n,x,sol,ciur[10000010],a,b;
int main(){
cin>>a>>b;
if(a==1){
sol=1;
}
for(int i=2;i<=b;i++){
for(int j=i+i;j<=b;j+=i){
ciur[j]+=i;
}
x=ciur[i]+1-i;
x=max(x,-x);
if(i>=a){
sol+=x;
}
}
cout<<sol;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Incorrect |
5 ms |
764 KB |
Output isn't correct |
4 |
Incorrect |
1361 ms |
39496 KB |
Output isn't correct |
5 |
Incorrect |
1609 ms |
39528 KB |
Output isn't correct |
6 |
Incorrect |
1526 ms |
39544 KB |
Output isn't correct |
7 |
Incorrect |
1222 ms |
36424 KB |
Output isn't correct |
8 |
Incorrect |
131 ms |
10232 KB |
Output isn't correct |