Submission #97091

#TimeUsernameProblemLanguageResultExecution timeMemory
97091karlopuhSavrsen (COCI17_savrsen)C++14
120 / 120
2842 ms78712 KiB
#include <bits/stdc++.h> using namespace std; int a,b; long long int sum[10000008]; long long int ans; int main(){ cin>>a>>b; for(int i=1;i<=b;i++){ for(int j=i;j<=b;j+=i){ sum[j]+=i; } } for(int i=a;i<=b;i++){ ans=ans+abs(i+i-sum[i]); } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...