結果

問題 No.2044 Infinite Nim
ユーザー 箱星
提出日時 2022-04-24 23:35:03
言語 Kotlin
(2.1.0)
結果
AC  
実行時間 530 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 12,655 ms
コンパイル使用メモリ 430,136 KB
実行使用メモリ 67,492 KB
最終ジャッジ日時 2024-10-09 06:00:50
合計ジャッジ時間 30,081 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:2:9: warning: variable 'n' is never used
    val n = readInt()
        ^

ソースコード

diff #

fun main() {
    val n = readInt()
    val a = readInts()
    val inf = a.count { it == -1 }
    val xor = a.filter { it != -1 }.fold(0, Int::xor)
    println(if (inf % 2 == 1 || xor != 0) "First" else "Second")
}

fun readInt() = readln().toInt()
fun readInts() = readln().split(" ").map { it.toInt() }
0