Show all threads Hide all threads Show all messages Hide all messages |
Почему надо запускаться от всех узлов? | >>> | 1463. Happiness to People! | 20 Jun 2024 09:38 | 2 |
я выбрал корнем вершину 1 и запускал в int main() дфс от этой вершины. Прошло 24 теста и упало на 25, но затем я запустился от всех вершин с условием if(!used[i]) dfs(i) и прошло. я не понял почему.. в условии не сказано, что это дерево, это может быть лес, то есть если запустить только один дфс, некоторые компоненты не обработаются |
If you get WA6 | Denis Koshman | 1463. Happiness to People! | 11 Mar 2023 15:22 | 2 |
Read problem statement more closely. The graph can be disconnected. Read problem statement more closely. The graph can be disconnected. Really helped me a lot. |
help wa 25 / wa 6 | >>> | 1463. Happiness to People! | 8 Nov 2021 16:59 | 1 |
|
if you have WA9... (+) | Dart MirzMan C++ Edition (Mirzoyan Alexey, Rybinsk SAAT) | 1463. Happiness to People! | 21 Sep 2018 00:05 | 2 |
4 0 0 0 0 0 Edited by author 23.05.2007 21:03 thanks, buddy it helped me |
Test 54 | Ashiqul Islam | 1463. Happiness to People! | 2 Sep 2017 16:19 | 1 |
Test 54 Ashiqul Islam 2 Sep 2017 16:19 What may be the test 54 ?? |
No subject | Felix_Mate | 1463. Happiness to People! | 21 Nov 2015 16:13 | 1 |
Edited by author 29.08.2016 21:00 |
WA Test 14. | Shayan Modiri | 1463. Happiness to People! | 24 Dec 2014 00:26 | 2 |
I tried all the samples from the discussion and I tried some exception conditions. The program works for all these samples. Do you have any idea what can be wrong? I can share my C++ code. Tried disconnected graphs, individual nodes, just a path, and zero edge and node weights. It works for all of the cases :/ |
WA8, some hints? PLZ | hliu20 | 1463. Happiness to People! | 24 Dec 2014 00:05 | 4 |
can anybody give some cases? what the #8 is? 9 8 1 5 4 6 10 1 2 2 1 1 2 1 2 3 10 2 4 1 4 5 1 4 6 2 6 7 2 6 8 3 3 9 1 Answer: 39 5 5 4 3 2 9 or 39 5 9 2 3 4 5 Answer: 39 5 5 4 2 3 9 or 39 5 9 3 2 4 5 |
why got WA#43, some hints? PLZ ! | Heng | 1463. Happiness to People! | 9 Dec 2013 11:43 | 1 |
Edited by author 09.12.2013 11:44 |
how to choose from which town to start? | Raman Gupta | 1463. Happiness to People! | 5 Apr 2013 16:19 | 5 |
I am getting TLE on test 24. How will you choose from which town to start? Because of this I had to start from every town to find the answer. For each town it took me O(n),so for all the towns it becomes O(n^2), causing TLE. Actually that's the main issue for this problem. If you want a hint - that's it: try to develop some dynamic programming scheme for solution. Edited by author 05.04.2013 16:20 Edited by author 05.04.2013 16:20 Finally AC! Slight implementation change got me AC!. Edited by author 05.04.2013 16:19 Edited by author 05.04.2013 16:19 |
Just BFS | Pavel Kovalenko | 1463. Happiness to People! | 26 Nov 2010 12:19 | 1 |
Just BFS Pavel Kovalenko 26 Nov 2010 12:19 No DP! Just 2 BFS for each connected component. |
if you have wa on test # 3 | Baurzhan | 1463. Happiness to People! | 22 Aug 2009 16:53 | 1 |
try this test: 3 2 0 0 1 1 2 1 1 3 1 answer is 3 3 3 1 2 Edited by author 15.01.2010 22:22 |
please give hint about test # 3 | Baurzhan | 1463. Happiness to People! | 22 Aug 2009 16:19 | 1 |
please give hint about test # 3 |
tell me what's wrong in my idea | Baurzhan | 1463. Happiness to People! | 21 Aug 2009 21:11 | 1 |
i decompose graph into connected components (by one dfs) after that i count diameter of each component(by one special_dfs) and refresh global_variable if need. my programm works at all my tests and sample test too. |
WA 29!!! | Lebedev_Nicolay[Ivanovo SPU] | 1463. Happiness to People! | 6 Jul 2009 00:14 | 5 |
WA 29!!! Lebedev_Nicolay[Ivanovo SPU] 29 Apr 2009 22:36 Can anybody give me test for WA #29??? Will anybody answer my question??? Will anybody answer my question??? Maybe in year or two. Forum is not for instant answers. It is rather knowledge base. There is no answer to your question in the base yet. Maybe answer will appear but 99% that _you_ will first find the bug and post yourself test for the bug here than someone get wa29 and post test for it. At last, I've solved it)))) If you have WA29 try this test: 8 6 1 2 5 4 1 2 1 6 1 2 1 2 3 1 2 4 1 5 6 1 6 7 1 6 8 1 Answer is : 13 3 3 2 4 |
Who have solved #1463 - help me. | Lebedev_Nicolay[Ivanovo SPU] | 1463. Happiness to People! | 6 May 2009 00:30 | 1 |
I have WA #29. At first i thought that it is simple overflow, but it is not right. |
WA #7 | Anton [SUrSU] | 1463. Happiness to People! | 14 Aug 2008 23:01 | 3 |
WA #7 Anton [SUrSU] 12 Oct 2006 01:35 maybe there isolated node? some like this 3 1 100 50 10 2 3 10 Edited by author 14.08.2008 23:02 |
To Admins | EarthShaker | 1463. Happiness to People! | 12 Mar 2008 17:56 | 1 |
I have tried for many times but always WA#29 Could you please tell me why? |
question | Lion | 1463. Happiness to People! | 8 Dec 2006 13:49 | 2 |
As I understood there is vertex with number "0" and what is happiness of town "0" ? I believe you've got the problem statement wrong, vertexes are numbered from 1 to N, so there is no town with number 0. |
How many edges in this graph? K<? | Alexander Prudaev | 1463. Happiness to People! | 25 Nov 2006 00:01 | 2 |
autors must add this restriction in Statement of the problem K is bounded by this condition: "It turned out that if Petrovich can fly (using one or several flights) from town i to town j, then there is exactly one way to do this" |