Hi,
yes I submitted, loaded the problem and re-submitted many times with no luck. There could also be a problem with my algorithm and not your test case but as a few people suggested there is no way to understand the issue without knowing what “complex hierarchy” means.
A few more sidenotes:
I get the same results regardless of whether in.nextLine is present or commented either before or inside the loop.
If I completely reload the solution by hitting the circular arrow button, instead of resetting the input algorithm of the problem I get a dummy “Hello world” code. This happens for all problems and all languages.
I also come up with this (not too soon though).
Each time you get pair of who influenced who, find corresponding nodes (small class in my case) in a dictionary (or create new).
Then show that who has an influence of who (in my case i had .Influence method). In the end you will have dictionary of N elements, you just get items with (already pre-calculated) most influence power.
People who are having troubles with the “complex hierarchy” test case, try validating the following graph by your solution: (1,2),(2,3),(2,4),(3,4),(4,5) and make sure that the result is 5.
It would be nice if it was included as one of the test cases in IDE.
I passed everything except the “Arbitrary Indexes”.
But I still don’t understand what this constraint is.
I read the description countless times, but still I don’t get it.
Does someone has a clue on this?
MERGE:
Just for info, I found out why !!!In my first try, I chose to use byte instead of int for the elements.
And the ‘Arbitrary Indexes’ are elements out of 0-255 range.
Hi, I had the same problem.
Think about the title of the test.
“Arbitrary indexes” means that the indexes are chosen “randomly”.
It means that the names of the vertices should not be used to determine the size of your data structure; e.g., you can have such an input :
3
7649 98
98 9
9 54
You have 4 different vertices, yet in your code you may be considering that you actually have 7649 vertices; which would make the program really inefficient.
Hello, my solution has passed all tests but “More complex hierarchy”. I read posts above, so I tried re-submit my solution several times, in order to validate again after issue with in.txt was resolved. Program language is C#. I checked, that case (1,2),(2,3),(1,3) returns 3, not 2. Can you please share with in.txt and out.txt for this test or share any ideas what differ that test from all other tests?
Something is wrong with the validator for A Well for C++. I got all the tests right with C++ the first time except A Well. Several alternate algorithms didn’t work as well. I ported my code to Python and it worked. Hmmm…
Hi. I have the same problem with ‘More complex hierarchy’ test, My algorithm achieve all other tests (including (1,2)(2,3)(2,4)(3,4)(4,5) = 5 as well). Can you share the input and output of this test (it would be very helpful, to find out what is wrong)? Language is C# and I tried more time to recheck my algorithm.