結果
問題 | No.706 多眼生物の調査 |
ユーザー | 💕💖💞 |
提出日時 | 2018-07-22 00:38:50 |
言語 | Kotlin (1.9.23) |
結果 |
AC
|
実行時間 | 520 ms / 2,000 ms |
コード長 | 322 bytes |
コンパイル時間 | 10,363 ms |
コンパイル使用メモリ | 435,892 KB |
実行使用メモリ | 74,688 KB |
最終ジャッジ日時 | 2024-04-30 19:02:08 |
合計ジャッジ時間 | 13,897 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 279 ms
57,028 KB |
testcase_01 | AC | 275 ms
57,024 KB |
testcase_02 | AC | 288 ms
57,236 KB |
testcase_03 | AC | 328 ms
57,268 KB |
testcase_04 | AC | 335 ms
57,320 KB |
testcase_05 | AC | 461 ms
65,388 KB |
testcase_06 | AC | 520 ms
74,688 KB |
testcase_07 | AC | 286 ms
57,124 KB |
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used fun main(args:Array<String>) { ^ Main.kt:3:38: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Pair<Int, Int> val maxSec = dd.maxBy { it.second }!!.second ^ Main.kt:4:26: warning: destructured parameter 'k' is never used val res = dd.filter { (k,size) -> size == maxSec }.map { (k, size) -> k }.max()!! ^ Main.kt:4:64: warning: destructured parameter 'size' is never used val res = dd.filter { (k,size) -> size == maxSec }.map { (k, size) -> k }.max()!! ^ Main.kt:4:82: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Int val res = dd.filter { (k,size) -> size == maxSec }.map { (k, size) -> k }.max()!! ^
ソースコード
fun main(args:Array<String>) { val dd = (1..readLine()!!.toInt()).map { readLine()!!.toList().filter { it == '^' }.size }.groupBy { it }.map { (k,vs) -> Pair(k, vs.size) } val maxSec = dd.maxBy { it.second }!!.second val res = dd.filter { (k,size) -> size == maxSec }.map { (k, size) -> k }.max()!! println(res) }