It’s my solution link for FFL
can someone tell me the mistake with my code…
Really can’t understand my mistake now also…will be thankful to you for my help with the mistake.

it will give error when there is only one kind of player , so if you will access the other player it will give segmentation fault.

check constraint n can be equal to 1


1 90

like in this testcase
this will pass your test case but i am getting WA

Since you are using If and else so when your code goes for the if it skips the input which it should take for this particular test case and it will take it as input for another case which results in WA.

I hope my post clarifies your doubt.

1 Like

thanks i got your point that i am skipping the input

and sir can you explain me when to use long long
since i am new to c++

Well generally in competitive programming you can use long long without an issue since there are very few questions with very tight space bounds so you can always use long long just keep in mind that an overflow can also occur when you add LONG_LONG_MAX with any other value.

You can use

cin.ignore(numeric_limits<streamsize>::max(), '\n');
cin.ignore(numeric_limits<streamsize>::max(), '\n');
cin.ignore(numeric_limits<streamsize>::max(), '\n');

Right after cout<<"no"<<"\n";

1 Like