11015 - 05-2 Rendezvous
Moderator: Board moderators
11015 - 05-2 Rendezvous
For the test data there is only one house that is directly connected to the rest (house 1). Does this mean that house 1 is the only possible meeting place or can people travel to other houses indirectly by using a series of connected houses?
Thanks!
Peter
Thanks!
Peter
-
- Learning poster
- Posts: 77
- Joined: Fri Dec 17, 2004 11:06 am
- Location: East West University, Dhaka, Bangladesh
- Contact:
Though I feel this one an easy problem, but getting WA
Here is my code... anyone can find my bug ? Thanx in advance.
![:cry:](./images/smilies/icon_cry.gif)
Here is my code... anyone can find my bug ? Thanx in advance.
Code: Select all
Accepted :)
Last edited by Niaz on Thu Apr 20, 2006 11:31 am, edited 1 time in total.
Please join The ACM Solver Group at Yahoo
http://groups.yahoo.com/group/acm_solver/
http://groups.yahoo.com/group/acm_solver/
-
- Experienced poster
- Posts: 111
- Joined: Mon Jan 09, 2006 6:19 pm
- Location: Tehran, Iran
- Contact:
-
- Learning poster
- Posts: 77
- Joined: Fri Dec 17, 2004 11:06 am
- Location: East West University, Dhaka, Bangladesh
- Contact:
Thanks to mf and arsalan_mousavian.
I am such a duffer! I used so many times FW but never did this mistake and how come I did it here ? Interestingly it gave the correct output for the sample inputs and that made me more crazy. I checked lot many things in my code (even thought about multiple paths also) but didn
I am such a duffer! I used so many times FW but never did this mistake and how come I did it here ? Interestingly it gave the correct output for the sample inputs and that made me more crazy. I checked lot many things in my code (even thought about multiple paths also) but didn
Please join The ACM Solver Group at Yahoo
http://groups.yahoo.com/group/acm_solver/
http://groups.yahoo.com/group/acm_solver/
11015 - 05-2 Rendezvous
when my program used
while (scanf("%d%d", &n, &m) == 2 && n && m) {...}
to read the data, i got WA
but when i use
while (scanf("%d%d", &n, &m), n) {...}
or
while (scanf("%d%d", &n, &m) == 2 && n) {...}
i've got AC !!
could M equal ZERO ??
notice 1 ? M ? (N^2-N)/2 !!
could anyone give me an explanation to this strange problem ?
while (scanf("%d%d", &n, &m) == 2 && n && m) {...}
to read the data, i got WA
but when i use
while (scanf("%d%d", &n, &m), n) {...}
or
while (scanf("%d%d", &n, &m) == 2 && n) {...}
i've got AC !!
could M equal ZERO ??
notice 1 ? M ? (N^2-N)/2 !!
could anyone give me an explanation to this strange problem ?
How are you using Dijkstra here?kallol wrote: Is Dijkstra not the proper algorithm here ??
![:-?](./images/smilies/icon_confused.gif)
Which node are you considering as the source??
If you are running N different dijkstras, considering every node as a src, then it should work..
.. but then again, why aren't you uisng Floyd-Warshall here.
FW is the most obvious one here........ at least, that's how I did it !!
11015 - 05-2 Rendezvous
Though its a straigh forward Floyd Warshall problem, I'm getting WA with it. I've run FW and then searched the house from where maximum houses are reacheable and then chosen the ont with the minimal distance. But getting WA. Can some1 hlp plz.I'm giving the code.
Code: Select all
removed after AC
Last edited by shihabrc on Thu Jul 20, 2006 8:17 pm, edited 1 time in total.
Shihab
CSE,BUET
CSE,BUET
help me
hi , i cant do anything more with 11015. No input output available in board. So i m bound to show my code. Plz help me out. I m getting wrong answer....plz help
plz send some critical i\o
thanx in advance
plz send some critical i\o
Code: Select all
code removed after A.C
Last edited by tuman on Wed Jul 26, 2006 6:45 pm, edited 2 times in total.
We the dreamer of the dreamy dream...
-
- A great helper
- Posts: 481
- Joined: Sun Jun 19, 2005 1:18 am
- Location: European Union (Slovak Republic)
Re: help me
There may be multiple edges between two vertices. At least, the problem statement does not say there are no such multiple esges. Maybe this is the reason of getting WA.tuman wrote:hi , i cant do anything more with 11015. No input output available in board. So i m bound to show my code. Plz help me out. I m getting wrong answer....plz help
Try to change tho following code to remember the shortest edge between two edges:
your code wrote:for(i=1;i<=b;i++){scanf("%ld%ld%ld",&c,&d,&p);
........adj[c][d]=p;
........adj[d][c]=p;
}