Submission #86372

# Submission time Handle Problem Language Result Execution time Memory
86372 2018-11-26T08:21:06 Z dimash241 Savrsen (COCI17_savrsen) C++17
45 / 120
12 ms 8764 KB
#include <iostream>
using namespace std;

int f[1010101];
int a, b;

int main () {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> a >> b;
	for (int i = 1; i < b; ++i) {
		int j = i + i;
		while (j <= b) {
			f[j] += i;
			j += i;
		}
	}

	long long ans = 0;
	for (int i = a; i <= b; ++i)
		ans += abs(f[i] - i);

	cout << ans;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 508 KB Output is correct
3 Correct 5 ms 896 KB Output is correct
4 Runtime error 11 ms 8652 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 11 ms 8652 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 12 ms 8764 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 11 ms 8764 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 11 ms 8764 KB Execution killed with signal 11 (could be triggered by violating memory limits)