結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
56,092 KB
testcase_01 AC 126 ms
55,824 KB
testcase_02 AC 127 ms
56,148 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 567 ms
60,628 KB
testcase_10 AC 840 ms
71,664 KB
testcase_11 AC 852 ms
64,984 KB
testcase_12 AC 825 ms
64,952 KB
testcase_13 AC 808 ms
64,480 KB
testcase_14 AC 851 ms
64,740 KB
testcase_15 AC 848 ms
64,656 KB
testcase_16 AC 900 ms
64,544 KB
testcase_17 AC 130 ms
55,720 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);
        int n = sc.nextInt();
        long t = 0L;
        for(int i = 0 ; i < n ; i++){
            t += sc.nextInt();
        }
        System.out.println(t);
    }
}
0