結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー tsunabittsunabit
提出日時 2018-03-25 03:26:10
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 811 bytes
コンパイル時間 3,220 ms
コンパイル使用メモリ 71,984 KB
実行使用メモリ 67,048 KB
最終ジャッジ日時 2023-09-07 10:42:51
合計ジャッジ時間 12,078 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,284 KB
testcase_01 AC 123 ms
55,784 KB
testcase_02 AC 125 ms
55,884 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 527 ms
59,560 KB
testcase_10 AC 775 ms
67,048 KB
testcase_11 AC 768 ms
65,136 KB
testcase_12 AC 770 ms
64,608 KB
testcase_13 AC 782 ms
64,472 KB
testcase_14 AC 832 ms
65,104 KB
testcase_15 AC 808 ms
64,756 KB
testcase_16 AC 862 ms
64,528 KB
testcase_17 AC 121 ms
55,836 KB
testcase_18 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

// 問題文
// N個の数値データが入力されるのでそれらの値の合計を求めてください。
// ただし、intなどの32ビット整数型では収まらないので注意してください。
// 入力
// 1行目にデータの個数N。
// 2行目に半角スペース区切りのN個の数値データ。
// 2≤N≤500000
// 0≤Ai<263 (1≤i≤N)
// 0≤∑1≤i≤NAi=A1+A2+…+AN<263
public class No9008 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);
        long n = sc.nextInt();
        long t = 0L;
        for(int i = 0 ; i < n ; i++){
            t += sc.nextInt();
        }
        System.out.println(t);
    }
}
0