結果

問題 No.24 数当てゲーム
ユーザー kajikaji
提出日時 2018-09-22 17:11:24
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 301 ms / 5,000 ms
コード長 468 bytes
コンパイル時間 12,471 ms
コンパイル使用メモリ 414,368 KB
実行使用メモリ 53,140 KB
最終ジャッジ日時 2023-08-13 00:24:41
合計ジャッジ時間 16,515 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 300 ms
52,744 KB
testcase_01 AC 298 ms
53,140 KB
testcase_02 AC 294 ms
52,732 KB
testcase_03 AC 298 ms
52,736 KB
testcase_04 AC 300 ms
52,736 KB
testcase_05 AC 295 ms
52,944 KB
testcase_06 AC 295 ms
52,996 KB
testcase_07 AC 299 ms
52,780 KB
testcase_08 AC 295 ms
52,756 KB
testcase_09 AC 301 ms
52,760 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    val turns = readLine()!!.toInt()
    var remains = (0..9).toSet()

    for (i in 1..turns) {
        val line = readLine()!!.split(" ")
        val nums = line.take(4).map(String::toInt)

        if (line.last() == "NO") {
            remains -= nums
        } else {
            remains = remains.intersect(nums)
        }
        if (remains.size == 1) {
            remains.forEach(::println)
            return
        }
    }
}
0