Submission #80570

#TimeUsernameProblemLanguageResultExecution timeMemory
80570tpoppoSavrsen (COCI17_savrsen)C++14
120 / 120
2196 ms79112 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MAXN = 1e7+1; ll a,b,res; ll sumDiv[MAXN]; int main(){ cin.tie(0); ios_base::sync_with_stdio(false); cin>>a>>b; for(int i=1;i<=b;i++){ for(int j=i;j<=b;j+=i) sumDiv[j]+=i; } for(;a<=b;a++) res += abs(2*a - sumDiv[a]); cout<<res; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...