Submission #371033

#TimeUsernameProblemLanguageResultExecution timeMemory
371033FatihSolakSavrsen (COCI17_savrsen)C++17
120 / 120
1335 ms39660 KiB
#include <bits/stdc++.h> #define N 10000005 using namespace std; int arr[N]; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); int a,b; cin >> a >> b; long long sum = 0; for(int i=1;i<N;i++){ for(int j=i+i;j<N;j+=i){ arr[j] -= i; } arr[i]+=i; } for(int i=a;i<=b;i++){ sum += abs(arr[i]); } cout << sum; }
#Verdict Execution timeMemoryGrader output
Fetching results...