結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー matsumomatsumo
提出日時 2020-11-14 22:41:21
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 448 ms / 3,000 ms
コード長 829 bytes
コンパイル時間 12,658 ms
コンパイル使用メモリ 424,484 KB
実行使用メモリ 55,916 KB
最終ジャッジ日時 2023-09-30 06:37:46
合計ジャッジ時間 20,566 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 261 ms
50,528 KB
testcase_01 AC 260 ms
50,348 KB
testcase_02 AC 261 ms
50,220 KB
testcase_03 AC 260 ms
50,564 KB
testcase_04 AC 262 ms
50,316 KB
testcase_05 AC 260 ms
50,668 KB
testcase_06 AC 278 ms
52,732 KB
testcase_07 AC 342 ms
52,916 KB
testcase_08 AC 354 ms
55,116 KB
testcase_09 AC 384 ms
55,536 KB
testcase_10 AC 448 ms
55,508 KB
testcase_11 AC 384 ms
55,552 KB
testcase_12 AC 388 ms
55,308 KB
testcase_13 AC 433 ms
55,408 KB
testcase_14 AC 432 ms
55,348 KB
testcase_15 AC 427 ms
55,916 KB
testcase_16 AC 391 ms
55,544 KB
testcase_17 AC 263 ms
50,548 KB
testcase_18 AC 268 ms
50,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter

val br = BufferedReader(InputStreamReader(System.`in`))
val out = PrintWriter(System.out)

fun main() {
    br.use {
        out.use {
//        repeat(readInteger()) { solve() }
            solve()
            out.flush()
        }
    }
}

fun solve() {
    val n = readInteger()
    var ans = 0L
    repeat(n) {
        ans += readLong()
    }
    out.println(ans)
}

fun readInteger() = Integer.parseInt(br.readLine())
fun readLong() = java.lang.Long.parseLong(br.readLine())
fun readStringList() = br.readLine()!!.split(' ')
fun readIntegerList() = readStringList().map(Integer::parseInt)
fun readLongList() = readStringList().map(java.lang.Long::parseLong)
fun readDoubleList() = readStringList().map(java.lang.Double::parseDouble)
0