제출 #86372

#제출 시각아이디문제언어결과실행 시간메모리
86372dimash241Savrsen (COCI17_savrsen)C++17
45 / 120
12 ms8764 KiB
#include <iostream>
using namespace std;

int f[1010101];
int a, b;

int main () {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> a >> b;
	for (int i = 1; i < b; ++i) {
		int j = i + i;
		while (j <= b) {
			f[j] += i;
			j += i;
		}
	}

	long long ans = 0;
	for (int i = a; i <= b; ++i)
		ans += abs(f[i] - i);

	cout << ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...