-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbasic kotlin.kt
More file actions
30 lines (29 loc) · 981 Bytes
/
basic kotlin.kt
File metadata and controls
30 lines (29 loc) · 981 Bytes
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
private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readDouble() = readLn().toDouble() // single double
private fun readLong() = readLn().toLong() // single long
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readDoubles() = readStrings().map { it.toDouble() } // list of doubles
private fun readLongs() = readStrings().map { it.toLong() } // list of longs
fun main(){
var t = readInt()
var ct = 0
while(ct < t){
var n = readInt()
var ans = 0
var it = 1
var a = readInts()
while(it < n){
if(Math.abs(a[it] - a[it - 1]) % 2 == 0){
ans = 1
}
++it
}
if(ans == 1)
println("YES")
else
println("NO")
++ct
}
}