Created
September 13, 2016 01:20
-
-
Save recursivecurry/66cc85eaacce9140770049bb3763bf57 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val edges: Map[Int,IndexedSeq[(Int,Int)]] = (for { | |
i <- 1 to m | |
Array(x, y, z) = StdIn.readLine().split("\\s+").map(_.toInt) | |
vs <- Seq(x - 1 ->(y - 1, z), y - 1 ->(x - 1, z)) | |
} yield vs).groupBy(_._1).mapValues(_.map(_._2)).view.force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment