MAY Challenge 2018:
Got stuck in the CodeChef May Challenge?
Here are our editorials: https://blancode.wordpress.com/codechef-contests/may18/
It’s mostly in layman’s terms, but if you need any kind of help, do not hesitate in wrtiting to us.
MAY Challenge 2018:
Got stuck in the CodeChef May Challenge?
Here are our editorials: https://blancode.wordpress.com/codechef-contests/may18/
It’s mostly in layman’s terms, but if you need any kind of help, do not hesitate in wrtiting to us.
Edited title for unambiguity.
Can you tell me the problem with this code for fake binary search in May Long Challenge? My submission is the given
link text
Very nice explanation of all the tutorials. Thank you for your efforts. I really appreciate it.
When you find out that the mid element need not to be swapped with any other, you are simply skipping. This creates a a problem as this element cannot be swaped so all the elements that are greater than x ( or smaller ) are not available for swaps.
When you check - cl < B[x] , you are assuming there are B[x] element that are available for swaps but all of them are not available some are at a position that cannot be swapped.
For more detailed explanation you can check out the editorial of Fake Binary search(it has been updated for a more detailed explanation).