Skip to content

Instantly share code, notes, and snippets.

@Rockbet
Last active October 6, 2021 14:41
Show Gist options
  • Save Rockbet/d95ff6efdb2437dd7177221e266bc398 to your computer and use it in GitHub Desktop.
Save Rockbet/d95ff6efdb2437dd7177221e266bc398 to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int a, b;
cin >> a >> b;
int ans = 0;
set<ll> quadrado, cubo;
for(int i=1; i<=10000; i++){
quadrado.insert(i*i);
cubo.insert(i*i*i);
}
for(auto x : quadrado){
if(a <= x and x <= b and cubo.count(x)) ans++;
}
cout << ans << "\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment