답안 #1062784

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1062784 2024-08-17T10:46:31 Z dimasnbayu Savrsen (COCI17_savrsen) C++14
15 / 120
140 ms 78692 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
int sum[10000005];
signed main(){
    int n,m; cin>>n>>m;
    for(int i=2;i*i<=sqrt(10000000);i++){
        for(int j=i+i;j<=m;j+=i) sum[j]+=i;
    }
    int ans=0;
    for(int i=n;i<=m;i++){
        ans+=abs(i-sum[i]-(i==1? 0:1));
        // cout<<abs(i-sum[i]-(i==1? 0:1))<<endl;
    }
    cout<<ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Incorrect 1 ms 2652 KB Output isn't correct
4 Incorrect 127 ms 78688 KB Output isn't correct
5 Incorrect 140 ms 78692 KB Output isn't correct
6 Incorrect 136 ms 78640 KB Output isn't correct
7 Incorrect 122 ms 72532 KB Output isn't correct
8 Incorrect 20 ms 20316 KB Output isn't correct