結果

問題 No.938 賢人を探せ
ユーザー KisaragiEffectiveKisaragiEffective
提出日時 2019-12-03 23:20:39
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 672 ms / 2,000 ms
コード長 408 bytes
コンパイル時間 11,140 ms
コンパイル使用メモリ 438,884 KB
実行使用メモリ 63,036 KB
最終ジャッジ日時 2024-05-08 09:02:11
合計ジャッジ時間 22,864 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 672 ms
63,036 KB
testcase_01 AC 294 ms
51,728 KB
testcase_02 AC 299 ms
51,648 KB
testcase_03 AC 297 ms
51,752 KB
testcase_04 AC 301 ms
51,812 KB
testcase_05 AC 295 ms
51,668 KB
testcase_06 AC 298 ms
51,532 KB
testcase_07 AC 306 ms
51,772 KB
testcase_08 AC 471 ms
58,956 KB
testcase_09 AC 480 ms
59,176 KB
testcase_10 AC 300 ms
51,760 KB
testcase_11 AC 487 ms
59,960 KB
testcase_12 AC 505 ms
59,360 KB
testcase_13 AC 520 ms
59,304 KB
testcase_14 AC 507 ms
59,332 KB
testcase_15 AC 516 ms
59,336 KB
testcase_16 AC 508 ms
59,240 KB
testcase_17 AC 511 ms
59,472 KB
testcase_18 AC 518 ms
59,272 KB
testcase_19 AC 516 ms
59,128 KB
testcase_20 AC 522 ms
59,192 KB
testcase_21 AC 506 ms
59,348 KB
testcase_22 AC 623 ms
62,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fun main() {
    val i = readLine()!!.toInt()
    val cheater = LinkedHashMap<String, String>(i)
    repeat(i) {
        val (c, d) = readLine()!!.split(" ")
        cheater[c] = d
    }
    
    val ok = ArrayList<String>()
    cheater.values.forEach { 
        // 被害者
        if (it !in cheater.keys) {
            ok += it
        }
    }
    
    ok.distinct().forEach {
        println(it)
    }
}
0