제출 #1244317

#제출 시각아이디문제언어결과실행 시간메모리
1244317minhpkSavrsen (COCI17_savrsen)C++20
120 / 120
880 ms78712 KiB
#include <bits/stdc++.h>
#define int long long
using namespace std;
int f[10000000];

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int a,b;
    cin >>a  >> b;
    int cnt=0;
    for (int i=1;i<=b;i+=1){
        for (int j=i*2;j<=b;j+=i){
            f[j]+=i;
        }
    }
    for (int i=a;i<=b;i+=1){
        cnt += abs(i-f[i]);
    }
    cout << cnt;
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...