SPOJ prata problem

Can you please share the code for spoj prata problem, it tried it many times but I failed

1 Like

Mam i tried submitting this code on SPOJ but while submiting it it showed an runtime error ([SIGABRT]).
can u please explain what could be the problem?(I edited the code to include testcases)

working for me at SPOJ


Mam this is the code i submitted today…it got accepted but time of execution came out to be 0.06 and that of your code which u gave now was 0.02…I’m new to competitive programming i want to know does this time matter? And if yes then why is mine more than yours though we both used almost similar algorithm…Please guide

1 Like

i c that ur code is soo same
i dont see a reason for the increased time

yes the time matters a bit
but i see ur code has O( N logn ) time similar to mine

1 Like

Would you please explain the isPossible function to me?
I ain’t getting it even when I dry run it.

In isPossible function, why count1-- is done, please explain that logic