|
|
This is my tests: <Test 1> input: 10 5 8 1 0 2 0 3 1 4 1 5 0 6 0 15 1 16 1 output: No reason 5 15 6 16 1 3 2 4 <Test 2> input: 11 1 18 1 0 2 0 3 0 4 0 6 0 7 0 8 0 9 0 11 0 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 output: Liar <Test 3> input: 4 2 8 7 0 8 0 9 0 19 1 20 0 21 1 22 1 23 1 output: No reason 20 21 7 19 8 23 9 22 Edited by author 29.03.2023 21:01 Your output for test 2 is incorrect. My AC solution gives: No reason 1 13 2 14 3 15 4 16 6 17 7 18 8 19 9 20 11 12 input: 6 3 8 1 0 2 0 3 0 4 0 5 1 7 1 10 1 12 1 output: No reason 1 10 2 5 3 12 4 7 Max bipartite matching algo works fine for O(VE). I have solved it using max bipartite matching. Is there any better idea? Are all the time-stamps recorded by the sensor guaranteed to be unique? I think this is implied by the fact that they are "increasing" (rather than "non-decreasing") but wanted to check. |
|
|