Activity selection

https://ide.codingblocks.com/s/447168 instead of giving output 1 4 8 11 its giving only 1 and 4

Hello @shrutikatyal you have doubt in which question activity selection or target sum pairs?

activity selection in greedy algorithm

like we have activities 1 2 3 4 5 6 7 8 9 10 11 and their starting time are 1 3 0 5 3 5 6 8 8 2 12 and their finish time are 4 5 6 7 9 9 10 11 12 14 16 so in output activity display should be activity 1 4 8 and 11 . but in my output only 1 and 4 activies come as output.

@shrutikatyal i can see the same question there on hackerblocks but the input format is different and in output you have to print the number of activities.

i have problem in activity selection

@shrutikatyal this is the question for activity selection and here the input and the ouput format is completely different as per what you are doing.
https://hack.codingblocks.com/app/practice/1/408/problem

see in this question take the input in the vector of pair type and then apply your logic and in output you have to just print the maximum number of activities.