Invitation to SpyBits, Udyam'21 - IIT (BHU) Varanasi (Rated for Div. 2 & Div. 3)

It seems my code is correct for problem D - Click Here
But I am getting WA in it, I have also covered the corner case (didn’t consider 1 as the special city).

I ran a DFS and calculated the distances of the leaf nodes(special cities) and then I greedily assigned the special cities to the people.

Can anyone point out the mistake, where I am going wrong?

When ratings will be updated?

Its mentioned in the question not to take the captial city (node 1) as a special node.

my bad. will this change alone work ? if(adj[v].size()==1 && v!=1)
I submitted but its still in queue

It should. Can’t find any other errors in your code

Never mind, I literally crossed all heights of stupidity be assuming A<B and getting those nasty RTES.

Thank you brother but I don’t get it what difference it makes by taking capital city also. I mean the problem setters purposefully use these kind of wierd and unnecessary condition to penalize or waste time of users. I really don’t find the need of such unnecessary confusions in problem statements as it teaches nothing

Well , you are wrong , It teaches people like me and you to read problem statements carefully , Yeah I also got a few WA because of that condition

3 Likes

The test cases for STONE LAND are really weak
this O(N*Q) solution works

@admin My junior rating graph is not updated although rating is. Will it be updated, can you look into it? Thanks.

Thanks for reporting. We’ll look into it.

Hi, should be fixed now.

1 Like

yes all good now

Thanks man such a silly mistake and I wasn’t able to figure it out.Thanks !!

1 Like