SHARE
TWEET

Untitled

a guest Jan 18th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<cmath>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main()
  8. {
  9.     long long a, b, k, ans = 0;
  10.     cin >> a >> b >> k;
  11.     for(long long y = 1; y <= 1000000; ++y)
  12.     {
  13.         if(a <= y*y*y && y*y*y <= b)
  14.         {
  15.             ans += floor(sqrt(min(b, y*y*y +k))) - ceil(sqrt(max(a, y*y*y - k))) + 1;
  16.         }
  17.     }
  18.     cout << ans;
  19.  
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top