Maximal Score PathProblem code: RG_01 |
All submissions for this problem are available.
Problem Statement
Given a weighted and undirected graph G = (V, E), let us define the score of an edge as its weight, and the score of a path as the minimum of the scores of its edges. For each pair of vertices (u, v), let us define a best path as a path with the maximal score, that starts at u and ends at v. Your task is to find out the score of a best path over all pairs of distinct vertices (u, v) given the description of the graph G.Input
The first line contains V, the number of vertices, and E, the number of edges in the graph. The graph will be weighted, undirected, simple (no self loops and no parallel edges), and connected. Each of the next E lines contains three non-negative integers u, v, and w, denoting that there is an edge (u, v) in the graph with a score of w. u and v are guaranteed to be distinct, and no edge will repeat in the input.
Output
Output a total of V lines each containing V integers. The vth integer on the uth line should be 0 if u = v, or the score of a best path that starts at vertex u and ends at vertex v.
Constraints
2 ? V ? 1000V - 1 ? E ? V(V - 1)/2
0 ? u, v ? V - 1
0 ? w ? 10^8
Example
Input: 3 3 0 1 1 1 2 2 0 2 3 Output: 0 2 3 2 0 2 3 2 0Warning
Large Input/Output. Use faster Input/Output techniques.
| Author: | rahulakaneo |
| Date Added: | 10-04-2011 |
| Time Limit: | 3 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC |
Comments

Fetching successful submissions

@admin: Problem statement
@admin: Ignore my above
Can anybody tell me the
what is significance of line
shouldn't the answer for
i mean 0 1 3 1 0 2 3 2 0
@writer Is the time limit
How can the score for path
@vikram535: There is a path
can anyone please explain me
Thanks for the explanation
Shouldn't the time limit in
please point me the technique
@assem_pandey: check out some
my algorithm is taking time
this is a request to the
calc_saransh: The time limit
do we need to consider the
@admin:do we need to consider
There seems to be something
pls help me , path is defined
@sukhrab: No constraint has
@rahulakaneo: I was talking
@subhrakb: I have seen some
@rahulakaneo :: r u admin for
I am a bit confused about the
Time limit is 3s per input
How many FloPS has your
After 4 submissions still