# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
40985 | Hassoony | Savrsen (COCI17_savrsen) | C++14 | 1511 ms | 39716 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef double D;
const ll inf=(1ll<<61);
const int mod=1e9+7;
const int MX=1e7+9;
const int SQ=350;
int A,B,F[MX];
int main(){
scanf("%d%d",&A,&B);
for(int i=1;i<=B;i++){
for(int j=i+i;j<=B;j+=i)
F[j]+=i;
}
ll ans=0;
for(int i=A;i<=B;i++){
ans+=(abs(i-F[i]));
}
cout<<ans<<endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |