[gcj] Re: Parenting Partnering Returns Question

2020-04-09 Thread MANASA
Hi Dhruva, Thanks for your input. The cHeap and jHeap are considering the values which were already assigned to C and J, hence their start time is already sorted. Since, the intervals are processed according to start time. Hence, the cHeap and jHeap are assigning the latest task itself, since

[gcj] Re: Parenting Partnering Returns Question

2020-04-09 Thread MANASA
Hi porker2008, Thanks for the help! I did not notice this at all. The code got submitted now. Regards, Manasa -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email

[gcj] Re: Parenting Partnering Returns Question

2020-04-09 Thread porker2008
Hi MANASA, > > I replied to you in another thread, so I just put a summary here. iterator from PriorityQueue does not return elements in a particular order , so your code does not actually work as your intended

[gcj] Re: Parenting Partnering Returns Question

2020-04-09 Thread Dhruva Sagar
Hi Manasa, I think the issue with your code is with your `cHeap` and `jHeap` and how they're used. Since `cHeap` & `jHeap` are sorted by end time, when you do a `peak()` you get the last activity with the largest end-time so far. The tasks you're processing from `oPQ` are however sorted by

[gcj] Re: Parenting Partnering Returns Question

2020-04-08 Thread MANASA
> > Hi, >> > I agree with the two points that you have mentioned. The strange part though is I had taken care of both the points during the submission, the sample testcase was working fine, and also other testcases that I tried on my IDE. But on submission, I got

[gcj] Re: Parenting Partnering Returns Question

2020-04-07 Thread Dhruva Sagar
I was successfully able to solve the problem post the competition. For everyone's benefit i'd like to point out the following common mistakes that people are doing, one of which I didn't think mattered, but unfortunately it did. 1. You must sort the activities by start time before trying to

[gcj] Re: Parenting Partnering Returns Question

2020-04-07 Thread samuel jawahar
Hello sir,please let me know for which test case it is failing please review my code Regards Samuel === import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class Solution { private static