trek's blog

By trek, 10 years ago, In English

problem:

Given two vertices of a graph,those are start point and end point and the weights of all edges in the graph are given.There are many paths exist from start vertex to end vertex.Find the weight of the minimum weighted edge that is present on each of those paths and find the maximum of those minimum weights.


input:
start point end point N — no. of edges
then N lines showing edges and their weights node1,node2,weight.

output:
out the maximum of those minimum weights .

note: the graph is connected and undirected.

Full text and comments »

  • Vote: I like it
  • -3
  • Vote: I do not like it

By trek, 10 years ago, In English

hi friends !!!!!!!

i have one problem.... please help me in solving it...

problem : given the nodes of the graph.All nodes are connected in such a manner that we can go any other node from any node.we need to keep marking at some of the nodes so that all nodes become protected. A node is said to be protected if that node has marked or the immediate adjacent node has marked.so,we need to to find the minimum number of markings we should place so that all nodes become protected.

for example :

input: N — no. of nodes, M — no.of edges
a[1] a[2]....... a[n]
m queries showing edges between nodes.

ex:
7 6
1 2 3 4 5 6 7
1 2
2 4
2 3
3 6
3 5
5 7

output:
answer — minimum no.of marks to be placed.

ex:
3

--for the above test case.

constraints :no. of nodes <=3000


task 1: if it is a tree..means having no cycles.

task 2: if it is a graph.

Full text and comments »

  • Vote: I like it
  • -11
  • Vote: I do not like it

By trek, 11 years ago, In English

http://www.codechef.com/problems/SNET

can anyone explain how to create adjecency matrix for the above problem and how to solve the above problem in detail..plz..plzzz...plzzzz..!!! thanks in advance

Full text and comments »

  • Vote: I like it
  • -18
  • Vote: I do not like it