結果
| 問題 | No.706 多眼生物の調査 |
| コンテスト | |
| ユーザー |
💕💖💞
|
| 提出日時 | 2018-07-22 00:38:50 |
| 言語 | Kotlin (2.3.20) |
| 結果 |
AC
|
| 実行時間 | 361 ms / 2,000 ms |
| コード長 | 322 bytes |
| 記録 | |
| コンパイル時間 | 10,696 ms |
| コンパイル使用メモリ | 472,832 KB |
| 実行使用メモリ | 69,820 KB |
| 最終ジャッジ日時 | 2026-05-14 19:32:36 |
| 合計ジャッジ時間 | 11,259 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 |
コンパイルメッセージ
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: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)
}
💕💖💞