-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.kt
65 lines (48 loc) · 1.51 KB
/
Main.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import java.io.*
import java.util.*
val isL = File("lib.kt").exists()
val d4x = intArrayOf(0,1,0,-1)
val d4y = intArrayOf(1,0,-1,0)
val d8x = intArrayOf(0,1,1,1,0,-1,-1,-1)
val d8y = intArrayOf(1,1,0,-1,-1,-1,0,1)
val imax = Int.MAX_VALUE
val imin = Int.MIN_VALUE
val lmax = Long.MAX_VALUE
val lmin = Long.MIN_VALUE
val umod = 1_000_000_007L
val cmod = 998_244_353L
val start = System.currentTimeMillis()
var n = 0
lateinit var p: IntArray
fun code() {
}
fun main() {
var T = 1
T = ini()
repeat(T) { code() }
isL.takeIf{it}?.let{ fh() }
bw.flush()
bw.close()
br.close()
System.gc()
}
// Additional I/O functions for competitive programming
fun ini(): Int = br.readLine().trim().toInt()
fun inl(): Long = br.readLine().trim().toLong()
fun ins(): String = br.readLine().trim()
fun inia(): IntArray = br.readLine().trim().split(" ").map { it.toInt() }.toIntArray()
fun inla(): LongArray = br.readLine().trim().split(" ").map { it.toLong() }.toLongArray()
fun insa(): Array<String> = br.readLine().trim().split(" ").toTypedArray()
fun pl(x: Any) { bw.write("${x.toString()} ") }
fun nl() { bw.write("\n") }
val br = when {
isL -> BufferedReader(FileReader("inp.txt"))
else-> BufferedReader(InputStreamReader(System.`in`))
}
val bw = when {
isL -> BufferedWriter(FileWriter("opt.txt"))
else-> BufferedWriter(OutputStreamWriter(System.out))
}
fun fh() {
bw.write("\nTime: ${System.currentTimeMillis()-start} ms\n")
}