結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー natume_shikinatume_shiki
提出日時 2018-08-24 04:50:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 329 ms / 2,000 ms
コード長 563 bytes
コンパイル時間 2,873 ms
コンパイル使用メモリ 71,992 KB
実行使用メモリ 87,804 KB
最終ジャッジ日時 2023-08-29 22:28:09
合計ジャッジ時間 7,261 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,424 KB
testcase_01 AC 42 ms
49,196 KB
testcase_02 AC 41 ms
49,732 KB
testcase_03 AC 42 ms
49,224 KB
testcase_04 AC 42 ms
47,296 KB
testcase_05 AC 44 ms
49,400 KB
testcase_06 AC 56 ms
50,404 KB
testcase_07 AC 108 ms
54,552 KB
testcase_08 AC 180 ms
60,316 KB
testcase_09 AC 184 ms
60,820 KB
testcase_10 AC 329 ms
85,996 KB
testcase_11 AC 310 ms
86,332 KB
testcase_12 AC 319 ms
85,380 KB
testcase_13 AC 325 ms
85,764 KB
testcase_14 AC 325 ms
85,796 KB
testcase_15 AC 311 ms
86,540 KB
testcase_16 AC 320 ms
87,804 KB
testcase_17 AC 42 ms
49,280 KB
testcase_18 AC 42 ms
49,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
public class No_9008{
	public static void main(String args[]){
		try{
			long sum = 0;
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int counter = Integer.parseInt(br.readLine());
			if((2 <= counter) && (counter <= 500000)){
				String sNumber = br.readLine();
				String[] sNum = sNumber.split(" ");
				Long[] num = new Long[sNum.length];
				for(int i = 0; i < num.length; i++){
					num[i] = Long.parseLong(sNum[i]);
					sum += num[i];
				}
			}
			System.out.println(sum);
		}catch(IOException e){}
	}
}
0