結果

問題 No.24 数当てゲーム
ユーザー minokasagominokasago
提出日時 2019-11-02 11:41:26
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 293 ms / 5,000 ms
コード長 379 bytes
コンパイル時間 12,140 ms
コンパイル使用メモリ 419,944 KB
実行使用メモリ 53,420 KB
最終ジャッジ日時 2023-10-13 01:15:25
合計ジャッジ時間 15,962 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 289 ms
53,236 KB
testcase_01 AC 288 ms
53,300 KB
testcase_02 AC 282 ms
53,140 KB
testcase_03 AC 289 ms
53,220 KB
testcase_04 AC 286 ms
53,072 KB
testcase_05 AC 284 ms
53,284 KB
testcase_06 AC 292 ms
53,176 KB
testcase_07 AC 288 ms
53,352 KB
testcase_08 AC 290 ms
53,192 KB
testcase_09 AC 293 ms
53,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fun main()
{
    val N = readLine()!!.toInt()
    var candidates = (0..9).toSet()
    repeat (N) {
        val line = readLine()!!.split(" ")
        val abcd = line.take(4).map(String::toInt)
        if (line.last() == "YES") {
            candidates = candidates.intersect(abcd)
        } else {
            candidates -= abcd
        }
    }
    println(candidates.first())
}
0