Submission #299737

#TimeUsernameProblemLanguageResultExecution timeMemory
299737dolijanSavrsen (COCI17_savrsen)C++14
120 / 120
1740 ms78636 KiB
#include<bits/stdc++.h> typedef long long ll; using namespace std; int main() { ll a,b; cin>>a>>b; ll zbirdelilaca[b+1]; for(ll i=a;i<=b;i++) zbirdelilaca[i]=0; for(ll i=1;i<=b;i++) { ll sta=2*i; while(sta<a) sta+=i; while(sta<=b) { zbirdelilaca[sta]+=i; sta+=i; } } ll kolko=0; for(ll i=a;i<=b;i++) kolko+=abs(i-zbirdelilaca[i]); cout<<kolko<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...