Submission #480569

#TimeUsernameProblemLanguageResultExecution timeMemory
480569varungoyalbitsSavrsen (COCI17_savrsen)C++17
120 / 120
1230 ms39428 KiB
/* https://oj.uz/problem/view/COCI17_savrsen */ #include <bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; vector<int> vec(b+1,0); for(int i=1;i<=b;i++) { for(int j=i;j<=b;j+=i) { vec[j]+=i; } } long long ans=0; for(int i=a;i<=b;i++) { ans+=(llabs(i-(vec[i]-i))); } cout<<ans<<"\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...