제출 #1133776

#제출 시각아이디문제언어결과실행 시간메모리
1133776lopkusSavrsen (COCI17_savrsen)C++20
30 / 120
568 ms39496 KiB
#include <bits/stdc++.h>

using namespace std;

const int N = 1e7 + 5;

vector<int> D(N, 0);

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    for(int i = 1; i < N; i++) {
        for(int j = i; j < N; j+= i) {
            D[j] += i;
        }
    }
    for(int i = 1; i < N; i++) {
        D[i] = D[i - 1] + abs((D[i] - i) - i);
    }
    int l, r;
    cin >> l >> r;
    cout << D[r] - D[l - 1];
}
#Verdict Execution timeMemoryGrader output
Fetching results...