結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー バカらっくバカらっく
提出日時 2021-11-10 10:09:16
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 458 ms / 5,000 ms
コード長 329 bytes
コンパイル時間 14,323 ms
コンパイル使用メモリ 444,992 KB
実行使用メモリ 67,868 KB
最終ジャッジ日時 2024-04-30 21:05:31
合計ジャッジ時間 20,616 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 314 ms
57,268 KB
testcase_01 AC 450 ms
67,724 KB
testcase_02 AC 270 ms
56,856 KB
testcase_03 AC 263 ms
56,876 KB
testcase_04 AC 270 ms
56,896 KB
testcase_05 AC 454 ms
67,816 KB
testcase_06 AC 270 ms
56,880 KB
testcase_07 AC 267 ms
56,992 KB
testcase_08 AC 277 ms
56,960 KB
testcase_09 AC 265 ms
56,864 KB
testcase_10 AC 275 ms
57,092 KB
testcase_11 AC 267 ms
56,976 KB
testcase_12 AC 270 ms
56,904 KB
testcase_13 AC 268 ms
56,852 KB
testcase_14 AC 449 ms
63,456 KB
testcase_15 AC 374 ms
59,600 KB
testcase_16 AC 445 ms
65,764 KB
testcase_17 AC 377 ms
59,632 KB
testcase_18 AC 431 ms
65,656 KB
testcase_19 AC 427 ms
63,720 KB
testcase_20 AC 446 ms
67,868 KB
testcase_21 AC 307 ms
57,060 KB
testcase_22 AC 396 ms
61,840 KB
testcase_23 AC 447 ms
67,856 KB
testcase_24 AC 458 ms
67,696 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^
Main.kt:2:9: warning: variable 'n' is never used
    val n = readLine()!!.toInt()
        ^

ソースコード

diff #

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val l = readLine()!!.split(" ").map { it.toInt() }
    val cnt = mutableMapOf<Int,Int>()
    l.forEach { cnt[it] = (cnt[it]?:0) + 1 }
    val ans = cnt.let { cnt.maxOf { it.value }.let { m -> cnt.filter { it.value == m }.maxOf { it.key } } }
    println(ans)
}
0