D-Dimensional MST SOLUTIONS DDIMMST

D-Dimensional MST SOLUTIONS OCTOBER CHALLENGE 2020

You are given N points in D-dimensional space.
 
Each point is given by D coordinates xi,1,xi,2,…,xi,D.
 
Weight of an edge between points i and j is |xi,1−xj,1|+|xi,2−xj,2|+…+|xi,D−xj,D|.
 
Find the weight of the maximum spanning tree.
 
Input:
The first line contains two integers N,D.
Each of the next N lines contains a description of a point, in i-th of them you are given D integer: xi,1,xi,2,…,xi,D..
Output:
One line: Max Spanning Tree Weight
 
Constraints
1≤D≤5
1≤N≤200000
0≤Xi,j≤100000
Subtasks
10 points, N≤5000
90 points, N≤200000
Sample Input:
2 2
1 1
2 2
 
Sample Output:
2
 
FOR LOGIC CLICK BELOW
 
As the question is not clear to begin with and we are sorry for late response. We suggest you guys to go on that link to Hackerearth and that is your solutions this question is MAXIMUM SPANNING TREE
Please do not copy the code from hackearth and submit. Please Try own your own.
We don’t promote cheating so please don’t copy and paste.
 

November Challenge 2020 SOLUTION CodeChef

October Lunchtime 2020 CodeChef SOLUTIONS

RELATED :

Related :

Related :

10 thoughts on “D-Dimensional MST SOLUTIONS DDIMMST”

  1. Within few days we are going to release the logic for all the questions at once, so please be patience and keep coding, your really working hard.

    Reply
  2. Sorry there is no video for this question but to cut off your work we will suggest follow Maximum Spanning Tree LOgic it will clear all your doubts.
    The question itself has not proper explanation thats why many people are missing the point Look for Maximum Spanning Tree Question on HackerEarth. You'll find your solutions there

    Reply
  3. Sorry the reason for no video was that their is no video shared on this question and we don't have youtube to begin with.

    To cut off your work we suggest you to follow Maximum Spanning Tree Logic it will clear all your doubts.The question itself has not proper explanation thats why many people are missing the point Look for Maximum Spanning Tree Question on HackerEarth. You'll find your solutions there.

    Any more queries leave a message and sorry for late response.

    Thanks for your understanding

    Reply

Leave a Comment