pls tell the mistakes in my code
Pls tell why my code is wrong
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
hello i can only see hello world code in the reply u sent and my code is showing time exceeded
#include using namespace std; int ayush( int M){ int a=1,c=0; int ans1=0; while(ans1<=M){ ans1=ans1+a; a=a+2; c++; } return c; } int harshit(int N){ int b=2,d=0; int ans2=0; while(ans2<=N){ ans2=ans2+b; b=b+2; d++; } return d; } int main(){ int T,k=1; long long M,N,x,y; cin>>T; while(k<=T){ cin>>M; cin>>N; if(ayush(M)>harshit(N)){ cout<<“Aayush”<<endl; } else if(ayush(M)>=harshit(N)){ cout<<“Harshit”<<endl; } } k++; }
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.