Created
October 23, 2017 06:53
-
-
Save optician/830cb8fe1212eae055ec9fdfb1cd78a8 to your computer and use it in GitHub Desktop.
scala/java version. About 11sec
This file contains 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
import scala.io._ | |
import java.io._ | |
import scala.collection.mutable.ArrayBuffer | |
object Main { | |
def main(args: Array[String]): Unit = { | |
var i = 0 | |
var v1: ArrayBuffer[String] = new ArrayBuffer(10000) | |
var v2: ArrayBuffer[String] = new ArrayBuffer(10000) | |
Source.stdin.getLines.foreach{ | |
x => | |
val arr = x.split(' ') | |
v1 += arr(0) | |
v2 += arr(1) | |
i += 1 | |
} | |
val writer = new PrintWriter(System.out) | |
for { | |
x <- v1 | |
y <- v2 | |
} yield writer.write(x + y + "\n") | |
writer.flush() | |
writer.close() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment