結果

問題 No.2044 Infinite Nim
ユーザー 👑 箱星箱星
提出日時 2022-04-24 23:35:03
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 542 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 13,180 ms
コンパイル使用メモリ 439,616 KB
実行使用メモリ 67,516 KB
最終ジャッジ日時 2024-04-17 11:56:57
合計ジャッジ時間 30,734 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 310 ms
51,604 KB
testcase_01 AC 310 ms
51,856 KB
testcase_02 AC 312 ms
51,984 KB
testcase_03 AC 309 ms
51,636 KB
testcase_04 AC 309 ms
51,800 KB
testcase_05 AC 314 ms
51,652 KB
testcase_06 AC 315 ms
51,780 KB
testcase_07 AC 313 ms
51,664 KB
testcase_08 AC 312 ms
51,868 KB
testcase_09 AC 313 ms
51,528 KB
testcase_10 AC 309 ms
51,852 KB
testcase_11 AC 309 ms
51,792 KB
testcase_12 AC 308 ms
51,900 KB
testcase_13 AC 510 ms
60,444 KB
testcase_14 AC 492 ms
57,508 KB
testcase_15 AC 480 ms
56,828 KB
testcase_16 AC 487 ms
57,528 KB
testcase_17 AC 523 ms
62,320 KB
testcase_18 AC 490 ms
56,792 KB
testcase_19 AC 484 ms
57,244 KB
testcase_20 AC 508 ms
60,120 KB
testcase_21 AC 531 ms
63,488 KB
testcase_22 AC 504 ms
59,488 KB
testcase_23 AC 490 ms
57,928 KB
testcase_24 AC 523 ms
61,724 KB
testcase_25 AC 499 ms
59,488 KB
testcase_26 AC 516 ms
61,712 KB
testcase_27 AC 481 ms
57,396 KB
testcase_28 AC 526 ms
63,548 KB
testcase_29 AC 502 ms
60,084 KB
testcase_30 AC 518 ms
61,684 KB
testcase_31 AC 536 ms
65,596 KB
testcase_32 AC 532 ms
65,628 KB
testcase_33 AC 533 ms
65,688 KB
testcase_34 AC 500 ms
62,176 KB
testcase_35 AC 542 ms
67,516 KB
testcase_36 AC 308 ms
51,856 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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