one test case does not pass why this happens can you check my code
Maximum circle problem
You can follow this approach
Take in input the centers and radii of the circles. Find the leftmost and rightmost points of these circles by
left = c[i] - r[i];
right = c[i] + r[i];
Store these left and right as a pair and sort this array of pairs in increasing order of right. Then run the greedy algo.
You can refer this code https://ide.codingblocks.com/s/259789
If you want me to check your code, then save your code on ide.codingblocks.com and share its link.
c and r can be upto 10^9. So use data types as long long int and then check.
it doesn’t work 3rd test case didn’t pass
Change line 26 to for(int i=1;i<n;i++)
thanku it passes all the test cases so whats the problem in my code can u plzz explain
There will be total n pairs in vector v from 0 to n-1… but your loop was till < n-1
ohk sir just a small fault and my whole test case didn’t run thanku