sajid161

Class - 30 : Task - 3

Jan 27th, 2025
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  4. typedef long long ll;
  5. map<long long, bool>mp;
  6. void div_gen(ll n)
  7. {
  8.     for(ll i=1;i<=n;i++)
  9.     {
  10.         mp[1ll*i*i]=1;
  11.     }
  12. }
  13. int main()
  14. {
  15.     optimize();
  16.     div_gen(32e4);
  17.     ll t;
  18.     cin>>t;
  19.     while(t--)
  20.     {
  21.         ll n;
  22.         cin>>n;
  23.         if(mp[n]) cout<<"YES"<<endl;
  24.         else cout<<"NO"<<endl;
  25.  
  26.     }
  27. }
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment