結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー morip26morip26
提出日時 2017-06-02 12:49:30
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 317 bytes
コンパイル時間 3,426 ms
コンパイル使用メモリ 77,176 KB
実行使用メモリ 72,544 KB
最終ジャッジ日時 2023-10-21 20:44:05
合計ジャッジ時間 11,381 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
57,372 KB
testcase_01 AC 126 ms
57,400 KB
testcase_02 AC 112 ms
56,136 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 490 ms
62,196 KB
testcase_10 AC 749 ms
72,544 KB
testcase_11 AC 788 ms
72,396 KB
testcase_12 AC 772 ms
72,344 KB
testcase_13 AC 784 ms
72,332 KB
testcase_14 AC 806 ms
72,300 KB
testcase_15 AC 785 ms
72,388 KB
testcase_16 AC 852 ms
72,360 KB
testcase_17 AC 118 ms
57,104 KB
testcase_18 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Nsum {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long a = sc.nextInt();
		long x = 0;
		for (long i = 1 ; i <= a ; i++){
			long b = sc.nextInt();
			x += b;
			if(i == a){
				System.out.println(x);
			}
		}
	}

}
0