Advertisement
bibaboba12345

лол

Nov 21st, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. #pragma GCC target ("avx2")
  2. #pragma GCC optimization ("O3")
  3. #pragma GCC optimization ("unroll-loops")
  4. #include <iostream>
  5. #include <cmath>
  6. #include <algorithm>
  7. #include <vector>
  8. #include <set>
  9. #include <map>
  10. using namespace std;
  11. long long N = 1e6, INF = 2e16 + 7, MOD = 1e9 + 7;
  12. long long l, r, b, c;
  13. set < pair<long long, long long> > ans;
  14. int main()
  15. {
  16. //freopen("input.txt", "r", stdin);
  17. std::ios::sync_with_stdio(false);
  18. cin.tie(0);
  19. cin >> l >> r;
  20. if (l <= -1 && r >= -1) {
  21. cout << -1;
  22. return 0;
  23. }
  24. for (long long bc = l + 1; bc <= r + 1; bc++) {
  25. for (long long a = 1; a * a <= abs(bc); a++) {
  26. if (abs(bc) % a == 0) {
  27. ans.insert({ min(a + 1, bc / a + 1), max(a + 1, bc / a + 1) });
  28. ans.insert({ min(1 - a, 1 - bc / a), max(1 - a, 1 - bc / a) });
  29. }
  30. }
  31. }
  32. cout << ans.size();
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement