Last active
February 2, 2018 16:36
-
-
Save hendrawd/74b1e7c97948218117c0692b19b575b4 to your computer and use it in GitHub Desktop.
As Uwi's recommendation to create my own libary, so i create an IntelliJ File Template in kotlin for faster solve competitive programming problem. This use the fastest I/O that we can achieve in kotlin.
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 java.io.PrintWriter | |
import java.math.BigInteger | |
/** | |
* ${Website} | |
* Created on ${DAY} ${MONTH_NAME_FULL} ${YEAR} | |
* @author ${USER} | |
*/ | |
fun main(args: Array<String>) { | |
${NAME}() | |
} | |
@Suppress("ClassName", "unused") | |
private class ${NAME} { | |
private val fastOutput by lazy { | |
PrintWriter(System.out) | |
} | |
init { | |
var t = nextInt() | |
while (t-- > 0) { | |
// TODO please do your logic here | |
} | |
fastOutput.close() | |
} | |
private fun print(o: Any) { | |
fastOutput.print(o) | |
} | |
private fun println(o: Any) { | |
fastOutput.println(o) | |
} | |
private fun nextBigInteger(): BigInteger { | |
return BigInteger(nextString()) | |
} | |
private fun nextCharArray(): CharArray { | |
return nextString().toCharArray() | |
} | |
private fun nextDouble(): Double { | |
return nextString().toDouble() | |
} | |
private fun nextFloat(): Float { | |
return nextString().toFloat() | |
} | |
private fun nextInt(): Int { | |
return nextString().toInt() | |
} | |
private fun nextIntList(): List<Int> { | |
return nextString().split(" ").map { it.toInt() } | |
} | |
private fun nextIntMutableList(): MutableList<Int> { | |
return nextIntList().toMutableList() | |
} | |
private fun nextLong(): Long { | |
return nextString().toLong() | |
} | |
private fun nextString(): String { | |
return readLine()!! | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment