Submission #86343

# Submission time Handle Problem Language Result Execution time Memory
86343 2018-11-26T07:41:47 Z Asag Savrsen (COCI17_savrsen) C++14
30 / 120
37 ms 772 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  <= 10000;i ++)
	{
		for(int j = i + i; j <= 10000 ;j +=i)
		{
			sum[j]+=i;
		}
	}sum[1] = 1;
	for(int i = n;i <= m ;i ++)
	{
		ans+=abs(i - (sum[i] + 1));
    }cout<<ans;
} 
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 3 ms 524 KB Output is correct
3 Incorrect 3 ms 524 KB Output isn't correct
4 Incorrect 2 ms 524 KB Output isn't correct
5 Incorrect 33 ms 772 KB Output isn't correct
6 Incorrect 37 ms 772 KB Output isn't correct
7 Incorrect 32 ms 772 KB Output isn't correct
8 Incorrect 11 ms 772 KB Output isn't correct