답안 #86344

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
86344 2018-11-26T07:42:44 Z Asag Savrsen (COCI17_savrsen) C++17
30 / 120
40 ms 1440 KB
#include <bits/stdc++.h>
using namespace std;
long long n,m,sum[10000000 + 5],ans;
int main()
{
	cin>>n>>m;
	for(int i = 2; i  <= 100000;i ++)
	{
		for(int j = i + i; j <= 100000 ;j +=i)
		{
			sum[j]+=i;
		}
	}sum[1] = 1;
	for(int i = n;i <= m ;i ++)
	{
		ans+=abs(i - (sum[i] + 1));
    }cout<<ans;
} 
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 1144 KB Output is correct
2 Correct 6 ms 1144 KB Output is correct
3 Incorrect 6 ms 1176 KB Output isn't correct
4 Incorrect 6 ms 1176 KB Output isn't correct
5 Incorrect 36 ms 1360 KB Output isn't correct
6 Incorrect 40 ms 1380 KB Output isn't correct
7 Incorrect 35 ms 1440 KB Output isn't correct
8 Incorrect 14 ms 1440 KB Output isn't correct