結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー Hoboteru4484Hoboteru4484
提出日時 2019-11-30 22:28:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 840 ms / 3,000 ms
コード長 313 bytes
コンパイル時間 3,159 ms
コンパイル使用メモリ 73,136 KB
実行使用メモリ 65,364 KB
最終ジャッジ日時 2023-08-13 09:50:00
合計ジャッジ時間 12,824 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,100 KB
testcase_01 AC 123 ms
55,952 KB
testcase_02 AC 123 ms
55,852 KB
testcase_03 AC 124 ms
56,060 KB
testcase_04 AC 124 ms
56,316 KB
testcase_05 AC 133 ms
55,916 KB
testcase_06 AC 187 ms
56,440 KB
testcase_07 AC 276 ms
60,352 KB
testcase_08 AC 490 ms
60,352 KB
testcase_09 AC 559 ms
61,024 KB
testcase_10 AC 790 ms
64,800 KB
testcase_11 AC 785 ms
64,324 KB
testcase_12 AC 808 ms
62,260 KB
testcase_13 AC 779 ms
64,400 KB
testcase_14 AC 826 ms
65,364 KB
testcase_15 AC 816 ms
64,492 KB
testcase_16 AC 840 ms
64,508 KB
testcase_17 AC 120 ms
55,780 KB
testcase_18 AC 121 ms
56,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Answer {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int dataCount = sc.nextInt();
    long sum = 0;

    for(int i = 0;i < dataCount;i++){
      sum += sc.nextLong();
    }
    
    sc.close();
    System.out.println(sum);

  }
}
0