답안 #1062785

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1062785 2024-08-17T10:48:53 Z dimasnbayu Savrsen (COCI17_savrsen) C++14
30 / 120
329 ms 78684 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<=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 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 2 ms 2652 KB Output isn't correct
4 Incorrect 315 ms 78680 KB Output isn't correct
5 Incorrect 322 ms 78684 KB Output isn't correct
6 Incorrect 329 ms 78680 KB Output isn't correct
7 Incorrect 297 ms 72532 KB Output isn't correct
8 Incorrect 50 ms 20320 KB Output isn't correct