結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー rutilicus
提出日時 2020-08-30 20:44:01
言語 Kotlin
(2.1.0)
結果
AC  
実行時間 524 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 11,030 ms
コンパイル使用メモリ 427,504 KB
実行使用メモリ 107,148 KB
最終ジャッジ日時 2024-11-15 15:22:47
合計ジャッジ時間 18,574 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
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