結果

問題 No.784 「,(カンマ)」
ユーザー 💕💖💞💕💖💞
提出日時 2019-05-06 15:02:21
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 294 ms / 2,000 ms
コード長 273 bytes
コンパイル時間 11,810 ms
コンパイル使用メモリ 420,416 KB
実行使用メモリ 53,120 KB
最終ジャッジ日時 2023-08-13 01:56:24
合計ジャッジ時間 16,855 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 290 ms
53,024 KB
testcase_01 AC 289 ms
52,680 KB
testcase_02 AC 288 ms
52,820 KB
testcase_03 AC 286 ms
52,792 KB
testcase_04 AC 286 ms
52,968 KB
testcase_05 AC 285 ms
52,984 KB
testcase_06 AC 283 ms
52,796 KB
testcase_07 AC 288 ms
52,748 KB
testcase_08 AC 291 ms
52,824 KB
testcase_09 AC 294 ms
52,716 KB
testcase_10 AC 293 ms
53,120 KB
testcase_11 AC 288 ms
52,796 KB
testcase_12 AC 288 ms
52,768 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args:Array<String>) {
         ^

ソースコード

diff #

fun main(args:Array<String>) {

    val ml = mutableListOf<String>()
    readLine()!!.toList().reversed().mapIndexed {index, it ->
        if( index != 0 && index%3 == 0) ml.add(",")
        ml.add(it.toString())
    }
    ml.reversed().joinToString("").let{println(it)}
}
0