Skip to content

Instantly share code, notes, and snippets.

@ffloyd
Created August 1, 2014 22:41
Show Gist options
  • Save ffloyd/9a378f2cf49a6bbbf7ff to your computer and use it in GitHub Desktop.
Save ffloyd/9a378f2cf49a6bbbf7ff to your computer and use it in GitHub Desktop.
time limit bullshit
object Problem1001 extends App {
val numbersStrings = io.Source.stdin.getLines()
for {
x <- numbersStrings.flatMap {
_.split(" ").filterNot { _.isEmpty }.map { x => math.sqrt(x.toDouble) }
}.toList.reverse
} yield println(f"$x%.04f".replace(',', '.'))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment