結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー KahoMatsumotoKahoMatsumoto
提出日時 2017-05-23 19:09:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,043 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 3,821 ms
コンパイル使用メモリ 74,448 KB
実行使用メモリ 76,488 KB
最終ジャッジ日時 2023-10-19 15:38:46
合計ジャッジ時間 14,490 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
55,552 KB
testcase_01 AC 133 ms
57,564 KB
testcase_02 AC 133 ms
57,496 KB
testcase_03 AC 132 ms
57,536 KB
testcase_04 AC 134 ms
57,648 KB
testcase_05 AC 145 ms
57,656 KB
testcase_06 AC 202 ms
57,992 KB
testcase_07 AC 298 ms
61,312 KB
testcase_08 AC 511 ms
62,012 KB
testcase_09 AC 581 ms
62,152 KB
testcase_10 AC 947 ms
74,668 KB
testcase_11 AC 913 ms
74,460 KB
testcase_12 AC 955 ms
74,508 KB
testcase_13 AC 941 ms
74,516 KB
testcase_14 AC 962 ms
76,488 KB
testcase_15 AC 992 ms
76,452 KB
testcase_16 AC 1,043 ms
76,468 KB
testcase_17 AC 134 ms
57,444 KB
testcase_18 AC 134 ms
57,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No9008 {
  public static void main(String[] args) {
    int n;
    Scanner sc = new Scanner(System.in);
    n = sc.nextInt();
    long[] l = new long[n];
    long sum = 0;
    for (int i = 0; i < n; i++) {
      l[i] = sc.nextLong();
    }
    for (int i = 0; i < n; i++) {
      sum += l[i];
    }
    System.out.println(sum);
  }
}
0