#include<bits/stdc++.h>
using namespace std;
void findpeople(double n)
{
float a=sqrt(2365log(1/(1-n)));
if(a-(int)a!=0)
{
cout<<(int)a+1;
}
else
{
cout<<(int)a;
}
}
int main() {
double n;
cin>>n;
findpeople(n);
return 0;
}
Birthday Paradox Problem code not getting accepted
hey @praritv1 in case the probability is 1 you need to print 366, please add an if condition for that seprately.
Rectified code: