Comments

thnx bro for ur answer i understood but how did u know to give a MIN function

i am getting RUNTIME ERROR on test case — 100000000 1000000000

what are u really telling bro LOL hahah

PLZ CAN U CORRECT MY FLAW AND GIVE IT TO ME I CAN"T UNDERSTAND IT PROPERLY BRO PLZ HELP I AM struggling for about 2-3 days now and not able to do this

actually i have just started DP PLZ UNDERSTAND AND HELP ME JUST REWRITE THE FUNCTION WITH REMOVING ALL FLAWS

thnx but can u explain it recursivly plz

actually i have just started with DP

thnx wait let me try this

sorry bro NOW CHECK IT PLZZZZ

Auto comment: topic has been updated by ABhinav2003 (previous revision, new revision, compare).

Auto comment: topic has been updated by ABhinav2003 (previous revision, new revision, compare).

hey fool first do a CP problem then talk!

yes i gone through Dp and backtraking but i still doubt my skill So what should i pratice as a beginner to understand that i am improving in DP.

abs not plz provide with more information

bro i have tried but some concepts is little difficult to understand like the Dynamic programming and Backtraking stuffs what shall i do then?

and if i do understand DP what question should i practice as a beginner ?? plz answer in detail bro

Bro You opened my eyes thanks for your help .One day , for sure , I WILL BECOME A RED CODER AND OUTWORK YOU.

A BIG THANKS..

include<bits/stdc++.h>

using namespace std;

bool prime(long long int a) { bool c= true; for(int i = 2;i<=sqrt(a);i++) { if(a%i == 0) { c = false; break; } } if(c == true ) return true; else return false;

}

bool T_PRIME(long long int a) { float test = sqrt(a) ; int test1 = floor(sqrt(a));

if(test - test1 == 0)
{
    if(prime(sqrt(a)) == true)
       return true;
    else
       return false;
}
else
    return false;

}

int main() { int t; cin>>t; vector a; for(int i = 0;i<t;i++) { int k; cin>>k; a.push_back(k);

}

for(auto i : a)
{
    if(T_PRIME(i) == true)
       cout<<"YES"<<"\n";
    else
       cout<<"NO"<<"\n";
}

}

WHAT IS WRONG IN THIS SOLUTION ITS FAILING ON TEST CASE 3