結果
問題 |
No.88 次はどっちだ
|
ユーザー |
![]() |
提出日時 | 2019-09-27 09:16:03 |
言語 | Kotlin (2.1.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 368 bytes |
コンパイル時間 | 11,735 ms |
コンパイル使用メモリ | 435,864 KB |
実行使用メモリ | 60,152 KB |
最終ジャッジ日時 | 2024-09-24 06:46:13 |
合計ジャッジ時間 | 16,228 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 WA * 5 |
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'arr' is never used fun main(arr:Array<String>) { ^ Main.kt:5:84: warning: 'sumBy((T) -> Int): Int' is deprecated. Use sumOf instead. val cnt =(1..8).map { readLine()!!}.let {a-> listOf('b','w').map {b->Pair(b,a.sumBy { c->c.filter { it == b }.count() } ) } }.toMap() ^
ソースコード
fun main(arr:Array<String>) { val players = listOf("oda","yukiko") val sente = readLine()!! val gote = players.findLast { it != sente }!! val cnt =(1..8).map { readLine()!!}.let {a-> listOf('b','w').map {b->Pair(b,a.sumBy { c->c.filter { it == b }.count() } ) } }.toMap() val ans = if(cnt['b']!! > cnt['w']!!) gote else sente println(ans) }