fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. bool checkSoCP(int n){
  5. int temp= sqrt(n);
  6. if(temp*temp == n) return 1;
  7. else return 0;
  8.  
  9. }
  10. int main() {
  11. int l,r;
  12. cin>>l>>r;
  13. int ans=0;
  14. for(int i=l+1;i<r;i++){
  15. if(checkSoCP(i)) ans++;
  16. }
  17. cout<<ans<<endl;
  18. return 0;
  19. }
Time limit exceeded #stdin #stdout 5s 5284KB
stdin
Standard input is empty
stdout
Standard output is empty