Skip to content

Instantly share code, notes, and snippets.

@recursivecurry
Created September 13, 2016 01:20
Show Gist options
  • Save recursivecurry/66cc85eaacce9140770049bb3763bf57 to your computer and use it in GitHub Desktop.
Save recursivecurry/66cc85eaacce9140770049bb3763bf57 to your computer and use it in GitHub Desktop.
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