Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <vector>
  4. #include <algorithm>
  5. #include <cmath>
  6.  
  7. using namespace std;
  8.  
  9. int main() {
  10. freopen("input.txt", "r", stdin);
  11. long long a, b, k;
  12. cin >> a >> b >> k;
  13. long long ans = 0;
  14. for (long long i = a; i * i * i <= b; ++i) {
  15. ans += min(b,(long long) sqrt(i * i * i + k)) - max(a, (long long) (sqrt(i * i * i - k) + 0.999));
  16. }
  17. cout << ans;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement