結果

問題 No.88 次はどっちだ
ユーザー バカらっくバカらっく
提出日時 2019-09-27 09:16:03
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 14,349 ms
コンパイル使用メモリ 435,472 KB
実行使用メモリ 58,096 KB
最終ジャッジ日時 2023-10-24 15:59:17
合計ジャッジ時間 17,787 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 325 ms
58,092 KB
testcase_01 AC 296 ms
58,084 KB
testcase_02 AC 309 ms
58,088 KB
testcase_03 AC 312 ms
58,084 KB
testcase_04 WA -
testcase_05 AC 299 ms
58,096 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 305 ms
58,088 KB
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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()
                                                                                   ^

ソースコード

diff #

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)
}

0