結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー rutilicusrutilicus
提出日時 2020-08-30 20:44:01
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 580 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 12,742 ms
コンパイル使用メモリ 419,656 KB
実行使用メモリ 85,248 KB
最終ジャッジ日時 2023-08-09 18:29:14
合計ジャッジ時間 19,949 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 273 ms
54,844 KB
testcase_01 AC 276 ms
52,708 KB
testcase_02 AC 277 ms
52,728 KB
testcase_03 AC 274 ms
52,712 KB
testcase_04 AC 271 ms
52,856 KB
testcase_05 AC 286 ms
52,820 KB
testcase_06 AC 314 ms
53,132 KB
testcase_07 AC 425 ms
54,732 KB
testcase_08 AC 452 ms
57,280 KB
testcase_09 AC 443 ms
57,588 KB
testcase_10 AC 556 ms
80,228 KB
testcase_11 AC 511 ms
76,100 KB
testcase_12 AC 503 ms
76,192 KB
testcase_13 AC 498 ms
76,504 KB
testcase_14 AC 519 ms
76,080 KB
testcase_15 AC 519 ms
76,232 KB
testcase_16 AC 580 ms
85,248 KB
testcase_17 AC 273 ms
52,656 KB
testcase_18 AC 275 ms
52,724 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:5:13: warning: 'appendln(Long): kotlin.text.StringBuilder /* = java.lang.StringBuilder */' is deprecated. Use appendLine instead. Note that the new method always appends the line feed character '\n' regardless of the system line separator.
    builder.appendln(readInputLine().split(" ").fold(0L) { acc, s -> acc + s.toLong() })
            ^

ソースコード

diff #

fun main() {
    val builder = StringBuilder()

    readInputLine()
    builder.appendln(readInputLine().split(" ").fold(0L) { acc, s -> acc + s.toLong() })

    print(builder.toString())
}

fun readInputLine(): String {
    return readLine()!!
}
0