Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma GCC target ("avx2")
- #pragma GCC optimization ("O3")
- #pragma GCC optimization ("unroll-loops")
- #include <iostream>
- #include <cmath>
- #include <algorithm>
- #include <vector>
- #include <set>
- #include <map>
- using namespace std;
- long long N = 1e6, INF = 2e16 + 7, MOD = 1e9 + 7;
- long long l, r, b, c;
- set < pair<long long, long long> > ans;
- int main()
- {
- //freopen("input.txt", "r", stdin);
- std::ios::sync_with_stdio(false);
- cin.tie(0);
- cin >> l >> r;
- if (l <= -1 && r >= -1) {
- cout << -1;
- return 0;
- }
- for (long long bc = l + 1; bc <= r + 1; bc++) {
- for (long long a = 1; a * a <= abs(bc); a++) {
- if (abs(bc) % a == 0) {
- ans.insert({ min(a + 1, bc / a + 1), max(a + 1, bc / a + 1) });
- ans.insert({ min(1 - a, 1 - bc / a), max(1 - a, 1 - bc / a) });
- }
- }
- }
- cout << ans.size();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement