diff --git a/230B T-primes/230B.cpp b/230B T-primes/230B.cpp new file mode 100644 index 0000000..a130459 --- /dev/null +++ b/230B T-primes/230B.cpp @@ -0,0 +1,41 @@ +#include +using namespace std; +using ll = long long; + +void solve() +{ + ll N = 1e6; + vectorprime(N+1,1); + prime[0]=prime[1]=0; + for (ll i = 2; i * i <= N; ++i) + { + if (prime[i]) + { + for (ll j = i*i; j <=N; j+=i) + prime[j]=0; + } + } + ll n; + cin>>n; + while(n--) + { + ll x; + cin>>x; + ll r= sqrt(x); + if(r*r!=x) cout<<"NO"<> TC; + // cin.ignore(); + while (TC--) + solve(); +} \ No newline at end of file