結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー KahoMatsumotoKahoMatsumoto
提出日時 2017-05-23 19:12:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 744 ms / 3,000 ms
コード長 373 bytes
コンパイル時間 3,852 ms
コンパイル使用メモリ 71,444 KB
実行使用メモリ 68,732 KB
最終ジャッジ日時 2023-08-26 17:07:01
合計ジャッジ時間 13,690 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
55,708 KB
testcase_01 AC 108 ms
55,956 KB
testcase_02 AC 107 ms
56,112 KB
testcase_03 AC 107 ms
55,988 KB
testcase_04 AC 115 ms
55,880 KB
testcase_05 AC 121 ms
56,428 KB
testcase_06 AC 169 ms
55,864 KB
testcase_07 AC 254 ms
60,312 KB
testcase_08 AC 403 ms
60,476 KB
testcase_09 AC 507 ms
60,672 KB
testcase_10 AC 722 ms
66,616 KB
testcase_11 AC 726 ms
66,884 KB
testcase_12 AC 690 ms
66,408 KB
testcase_13 AC 704 ms
66,364 KB
testcase_14 AC 713 ms
68,636 KB
testcase_15 AC 738 ms
68,432 KB
testcase_16 AC 744 ms
68,732 KB
testcase_17 AC 105 ms
55,884 KB
testcase_18 AC 103 ms
56,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No9009 {
  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