MST  Minimum Spanning Tree
Find the minimum spanning tree of the graph.
Input
On the first line there will be two integers N  the number of nodes and M  the number of edges. (1 <= N <= 10000), (1 <= M <= 100000)
M lines follow with three integers i j k on each line representing an edge between node i and j with weight k. The IDs of the nodes are between 1 and n inclusive. The weight of each edge will be <= 1000000.
Output
Single number representing the total weight of the minimum spanning tree on this graph. There will be only one possible MST.
Example
Input: 4 5 1 2 10 2 3 15 1 3 5 4 2 2 4 3 40 Output: 17
hide comments
ameyanator:
20180425 08:31:01
81.82 points with int data type and 100 with long long int 

ayushtewary07:
20180217 16:21:33
Accepted in one go!


ramini1996:
20180130 21:14:04
100 with Kruskal, AC in one go !!! 

ramprosad:
20171107 15:24:49
why isn't it accepted? I get 100 point.


amit88265:
20170823 19:02:33
i am using long long but still getting 18.18 and green!!!!!!....someone help please. 

lokesh1997:
20170802 15:11:02
what is this 18.18??


jainaman1398:
20170718 15:48:28
I did this using prims.AC in one go 

trungpro:
20170707 10:00:32
result is type long long in C++ or in64 in Pascal Last edit: 20170707 10:01:08 

onkar14_n:
20170626 15:41:34
AC in one go !!


ravi_ndra12345:
20170514 08:08:41
I am getting 81.82.

Added by:  Nikola P Borisov 
Date:  20081020 
Time limit:  1s2s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 