結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー rutilicusrutilicus
提出日時 2020-08-30 20:44:01
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 558 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 10,798 ms
コンパイル使用メモリ 426,228 KB
実行使用メモリ 107,200 KB
最終ジャッジ日時 2024-04-27 13:14:15
合計ジャッジ時間 19,805 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 297 ms
56,776 KB
testcase_01 AC 309 ms
56,952 KB
testcase_02 AC 295 ms
56,804 KB
testcase_03 AC 306 ms
56,928 KB
testcase_04 AC 296 ms
56,672 KB
testcase_05 AC 302 ms
56,736 KB
testcase_06 AC 342 ms
57,128 KB
testcase_07 AC 458 ms
59,108 KB
testcase_08 AC 475 ms
65,228 KB
testcase_09 AC 486 ms
65,340 KB
testcase_10 AC 548 ms
107,164 KB
testcase_11 AC 546 ms
107,188 KB
testcase_12 AC 547 ms
106,956 KB
testcase_13 AC 552 ms
107,112 KB
testcase_14 AC 553 ms
107,140 KB
testcase_15 AC 553 ms
107,200 KB
testcase_16 AC 558 ms
107,144 KB
testcase_17 AC 297 ms
56,876 KB
testcase_18 AC 301 ms
56,868 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