fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int t;
  7. cin >> t;
  8. while(t--)
  9. {
  10. int n;
  11. cin >> n;
  12. int count=0;
  13. for(int i=2;i<=n;i++)
  14. {
  15. int k=2;
  16. if(pow(k,i)==n && k<=n)
  17. count++;
  18. k++;
  19.  
  20. }
  21. if(count!=0)
  22. cout << "yes";
  23. else if(count==0)
  24. cout << "no";
  25. cout << endl;
  26. }
  27. return 0;
  28. }
Success #stdin #stdout 0.01s 5516KB
stdin
5
2
16
31
8880
961
stdout
no
yes
no
no
no