int main()
{
unsigned long long int i,t,N;
cin>>t; //INPUT NUMBER OF TEST CASE
while(t--)
{
count=0;
cin>>N;
if(N==0 || N==1) //IF FACTORIAL=0 OR 1
cout<<"1"<<endl;
else
{
i=1;
while(N!=1)
{
i++;
N/=i; //REDUCING THE NUMBER
}
cout<<i<<endl;
}
}
return 0;
}
I coded this solution, which gives the correct output for small integers.
I am getting the partially correct output. (Time Limit Exceeded is 2nd case). I think that there can be another approach to solve this question of dynamic programming. Please correct me if I'm wrong.