So I revisited the problem after reading the many posts.
So solution is below, it is working and tested.
For each case:
1. take input
2. sort the input , but keep the original order as well
3. Loop through sorted task and check if the task is not overlapping in C
-- assign C at original position,
Oh! That makes more sense why it was solved when reading in the full input.
Thanks for finally solving that mystery.
On Saturday, 11 April 2020 14:42:41 UTC+2, Robert Stacey wrote:
>
> There was also a runtime error - in your original code you'd break out of
> the loop when it became impossible
There was also a runtime error - in your original code you'd break out of
the loop when it became impossible and leave the rest of that test case in
the input buffer. You would then either try to read a line with one integer
and split it into two (RE) or read past the end of the buffer (RE) as
> Apparently "Case #3: CJJCC" is not a valid alternative for "Case #3:
> JCCJJ".
>
I think CJJCC should also be accepted.
--
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,
Turns out that it *was not* a Runtime Error. Thanks to @porker2008 I was
able to fix my answer by first sorting the activities. Apparently "Case #3:
CJJCC" is not a valid alternative for "Case #3: JCCJJ".
On Tuesday, 7 April 2020 02:44:08 UTC+2, eegee wrote:
>
> I keep getting a RE (Runtime