|
|
If you have WA test 4, try below test: 1 8 1 2 3 4 5 7 6 1 3 1 6 7 Answer: 5 7 I have WA4, tried your test and got the correct answer: 5 7 Do you have another test to check WA4? try this one input: 3 2 61 62 5 75 20 85 50 61 3 10 20 30 1 5 output: 5 4 3 75 85 20 2 61 62 5 75 20 85 50 61 3 10 20 30 3 30 20 85 Will answer include 75 or not? 50 61 62 85 Why 75 does not fall into answer? Because no shortest route from 30 to 75 begins with 30,20,85 30->20->85->75 is one. Because no shortest route from 30 to 75 begins with 30,20,85 30->20->75 is shortest not your one Edited by author 20.04.2021 14:07 Edited by author 20.04.2021 14:07 My AC program give answer 3 for a following test: 2 4 1 2 3 4 4 1 2 5 4 3 1 2 3 But I think answer must be: 3 4 Am I right? Yes. I think you are lucky you got AC. NO! My AC program give answer 3 for a following test: 2 4 1 2 3 4 4 1 2 5 4 3 1 2 3 But I think answer must be: 3 4 Am I right? the length of a route is determined by the number of spans only But what's span?! Read following few words - definition of span is there (in the subway, a span is a tunnel between two adjacent stations). but i still don't know... Span are edges!(I have no word to say~~~) (in the subway, a span is a tunnel between two adjacent stations). but i still don't know... Hello. I have received strange 'Compilation Error' verdict for my solution on the 1314 task under Microsoft Visual C++ 2017 compiler. Compilation log is as follows: ///////////////////////////////////////// lg1vr1-w2nnli(24): error C2062: type 'float' unexpected lg1vr1-w2nnli(84): warning C4244: 'argument': conversion from 'float' to 'const int', possible loss of data lg1vr1-w2nnli(94): warning C4018: '<': signed/unsigned mismatch ///////////////////////////////////////// Lines 23 and 24 of my code are: ///////////////////////////////////////// const int MAX_STATION_ID = 32767L; const int INFINITY = 10L * MAX_STATION_ID; ///////////////////////////////////////// Commits with CE are 8162255, 8162250, 8162248. But there is successful (Accepted) commit 8162257 (the same code as 8162255) under G++7.1 commit. Could you check if the CE message was correct or not? Best regards. Edited by author 04.12.2018 02:01 Need help, WA9! 2 2 1 2 2 3 4 1 1 Is this test possible or not? If someone wants to try to debug my code or give me a hint or help me some other way, send me a mail on dporobic@eunet.yu Detail that made my WA #3 to AC : If the line is defined as follows: 3 1 2 3 then spans are 1-2 and 2-3, and not 1-3!!! Line aren't cycles.... When I had WA#3, this test helped: 1 1 1 1 1 The right answer is 1 That isn't a valid test case, though, because the K >= 2. You cannot have a line with only one station. Anyone had WA10? I can't understand :( I do BFS twice, and I think it's correct algorithm Edited by author 08.11.2008 11:27 if there is a route like below: 3 1 2 3 Can I go from station 3 to station 1 directly? I mean, is the route a circle? Bellman-Ford I used two SSSP algo (BFS + DFS) to solve the problem. Can it be done with only one ? how to determinate the shortest route??? Why in the test input the criminal goes to 85 and not to 10 or 75???? I too Edited by author 21.04.2004 00:39 First do BFS with the first node in the criminal's route. Save the result in the array d1. Do another BFS with the last node in the criminal's route, and save the result in the array d2. For any node i, if d1[i]-d2[i]=m-1, then i is an answer. The graph is always connected. I build BFS traversal tree by giving priorities to points on the route (i.e. advance them first). Children of the last route node gain privelege for the rest of traversal (if you process nodes in the order they were first visited, this condition is automatic because they will be added prior to any other nodes during last privileged propagation). After BFS tree is ready, nodes reachable from last node on the route inside that tree form the answer. Edited by author 01.08.2008 05:09 My program works correct with ALL tests, that were above. But there is WA2 on check. oh.. try to use Floyd-Uorshell's algoritm.. its may to help you. |
|
|