|
+5
Finally !!! . this is a dumb bug actually xD i appreciate that you helped me ! |
|
0
amm how ? i for loop on them and put it equal 0. and i put memset to make sure if i miss something. but i still get wrong |
|
0
actually i was doing that i think.. i used bfs to know the level by that i can know how many vertices i visit from the u (initial) and then i get the max weight when level <= k, is that what you talking about ? and can you get accepted in it to make sure both of us understand the problem well ? |
|
0
yes, I misunderstood it, so let me recap what I understood. i need to find a path of L edges and sort the weight of the path so i can get the largest edge on Kth position, isnt it ? if so, i am stuck in how i am going to know that this is the perfect path that gives me largest edge on kth position |
|
+8
BTW in line 45 should be lev[i] but i forgot to update it on ideone |
|
+8
sorry didnt notice that i have to do it .. now it gives me wrong answer.. any idea what is wrong ? |
|
+5
Auto comment: topic has been updated by zeyad.alaaeldin2016 (previous revision, new revision, compare). |
|
+1
thanks didnt even realize |
|
0
Problem c division 2 why my solution gives TLE ? its O(LOG P) https://ideone.com/fDlClB |