iqdot
March 4, 2014, 12:14am
13
Guys can someone please tell me why my solution is being rejected:
http://www.codechef.com/viewsolution/3482076
I can’t see what’s wrong with it. I’m using the method of counting no of 1-label nodes in a tree for answer to 1 and pruning for the answer to 2.
I would really like to get some closure on this. Is my method of printing the answer somehow not being accepted?
s24w
March 4, 2014, 12:19am
14
plz post the tester’s and setter’s solution asap.
randsp
March 4, 2014, 8:39pm
15
Could anyone tell me what the heck is wrong with my solution?
http://www.codechef.com/viewsolution/3498164
s24w
March 5, 2014, 6:40pm
16
please tell me what is wrong with the sol
s24w
May 21, 2014, 11:11pm
17
what is to be done after calculating I[] of all nodes??
Plz somebody help
This is my after reading this editorial
http://www.codechef.com/viewsolution/3931123
it is giving WA
herman
February 17, 2014, 4:40pm
18
In this paragraph : “For this we make the tree rooted at some node r, …”(5th paragraph in EXPLANATION) What is “w” ?
djdolls
February 17, 2014, 4:47pm
19
It’s a generic node as defined in the previous paragraph. We need to iterate over all nodes w in the tree.
herman
February 17, 2014, 5:05pm
20
What do you mean by “reverse topological order” ?Please explain.
r3gz3n
February 17, 2014, 5:06pm
21
I used the same approach. I removed all such leaves iteratively CodeChef: Practical coding for everyone
Hm, I think now it’s clear to me…
Why there is not a better test case ? :’-(
r3gz3n
February 17, 2014, 5:35pm
23
Rubik’s answer is not n. As stated by @anton_lunyov in the contest “After solving the problem I could assert that draught is passing through the room if and only if this room lies on the path between two different rooms with open windows (regardless of whether it has open window or not). Regarding Furik question, it is clear enough: the pair of rooms should be counted if and only if they are connected and both have open windows.”
1 Like
djdolls
February 17, 2014, 5:46pm
24
This means a node should be visited only after all its children have been visited.
That shows that I’m an ignoramus, I read that comment, but somehow ignored it
yashv
February 17, 2014, 5:51pm
26
how to check the third case
djdolls
February 17, 2014, 6:00pm
27
You already have the I() values of all children of a node, just check if there are two or more children have nonzero I() value.
r3gz3n
February 17, 2014, 8:42pm
28
Actually the language of problem was very confusing. I also had 28 WA. Then I read this comment and it helped a lot Thanks to @anton_lunyov
ndof
February 17, 2014, 10:01pm
29
Actually i was able to solve it because of @anton_lunyov comment.Before that i interpreted as u @betlista .For me problem statement was confusing.
Eu1er
February 17, 2014, 11:13pm
30
@sambuddha - You did everything right … the only problem(the same i had) is that we forgot to explicit typecast the count to long long which cost me around 20 WA’s … here’s your AC solution which i tried
just modified the tot_count
http://www.codechef.com/viewsolution/3437568
… even though i found the problem i have no clue as to why it happens … if you have any idea please share it with me …
count is int and multiplying count by count is an integer that overflows integer value…although you are putting it up in long long variable but count*count is still int
1 Like
Eu1er
February 18, 2014, 12:30am
32
Thanks for the explanation … that was one big mistake.
1 Like