結果

問題 No.509 塗りつぶしツール
ユーザー 💕💖💞💕💖💞
提出日時 2017-06-27 21:57:37
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 330 ms / 2,000 ms
コード長 457 bytes
コンパイル時間 12,265 ms
コンパイル使用メモリ 435,508 KB
実行使用メモリ 60,548 KB
最終ジャッジ日時 2024-04-30 14:57:52
合計ジャッジ時間 20,006 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 279 ms
60,324 KB
testcase_01 AC 280 ms
60,548 KB
testcase_02 AC 290 ms
60,528 KB
testcase_03 AC 286 ms
60,428 KB
testcase_04 AC 284 ms
60,392 KB
testcase_05 AC 282 ms
60,316 KB
testcase_06 AC 283 ms
60,332 KB
testcase_07 AC 283 ms
60,428 KB
testcase_08 AC 330 ms
60,392 KB
testcase_09 AC 286 ms
60,292 KB
testcase_10 AC 281 ms
60,536 KB
testcase_11 AC 277 ms
60,404 KB
testcase_12 AC 284 ms
60,324 KB
testcase_13 AC 285 ms
60,456 KB
testcase_14 AC 276 ms
60,336 KB
testcase_15 AC 280 ms
60,300 KB
testcase_16 AC 285 ms
60,392 KB
testcase_17 AC 278 ms
60,388 KB
testcase_18 AC 277 ms
60,336 KB
testcase_19 AC 283 ms
60,468 KB
testcase_20 AC 276 ms
60,408 KB
testcase_21 AC 276 ms
60,404 KB
testcase_22 AC 277 ms
60,336 KB
testcase_23 AC 275 ms
60,432 KB
testcase_24 AC 277 ms
60,540 KB
testcase_25 AC 278 ms
60,392 KB
testcase_26 AC 284 ms
60,436 KB
testcase_27 AC 283 ms
60,456 KB
testcase_28 AC 279 ms
60,412 KB
testcase_29 AC 277 ms
60,420 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:11: warning: parameter 'args' is never used
fun main( args : Array<String> ) {
          ^

ソースコード

diff #

fun main( args : Array<String> ) {
   val m  = mapOf(0 to 1, 1 to 0, 2 to 0, 3 to 0, 4 to 1, 5 to 0, 6 to 1, 7 to 0, 8 to 2, 9 to 1)
   val txt = readLine()!!
   val an = txt.toList()
            .map { it.toString().toInt() }
            .map { x -> 
              m[x]!!.toInt() 
            }.reduce { y,x ->
              y+x
            }
   val inn = 1 + an + 2 * txt.length
   val ou  = 2 * ( 1 + an) + txt.length
   println( listOf(inn,ou).min() )
}
0