結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー ダンネックダンネック
提出日時 2020-05-21 22:35:17
言語 Java19
(openjdk 21)
結果
AC  
実行時間 905 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 3,452 ms
コンパイル使用メモリ 74,212 KB
実行使用メモリ 65,472 KB
最終ジャッジ日時 2023-07-25 14:50:48
合計ジャッジ時間 13,551 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
56,100 KB
testcase_01 AC 128 ms
55,684 KB
testcase_02 AC 129 ms
55,836 KB
testcase_03 AC 127 ms
55,600 KB
testcase_04 AC 128 ms
55,444 KB
testcase_05 AC 139 ms
55,460 KB
testcase_06 AC 196 ms
56,108 KB
testcase_07 AC 292 ms
60,396 KB
testcase_08 AC 497 ms
60,696 KB
testcase_09 AC 545 ms
60,708 KB
testcase_10 AC 844 ms
65,456 KB
testcase_11 AC 848 ms
65,300 KB
testcase_12 AC 855 ms
64,656 KB
testcase_13 AC 862 ms
65,464 KB
testcase_14 AC 871 ms
65,472 KB
testcase_15 AC 889 ms
64,816 KB
testcase_16 AC 905 ms
64,612 KB
testcase_17 AC 129 ms
55,756 KB
testcase_18 AC 129 ms
55,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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