結果
問題 |
No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
|
ユーザー |
|
提出日時 | 2019-04-06 23:57:19 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 385 bytes |
コンパイル時間 | 4,069 ms |
コンパイル使用メモリ | 75,060 KB |
実行使用メモリ | 77,632 KB |
最終ジャッジ日時 | 2024-06-25 06:01:01 |
合計ジャッジ時間 | 14,644 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 4 |
other | RE * 15 |
ソースコード
import java.util.Scanner; import java.util.ArrayList; public class Test{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); ArrayList<Long> list = new ArrayList<Long>(); int n = sc.nextInt(); while(sc.hasNext()){ list.add(sc.nextLong()); } long sum = 0; for(int i=1; i<=n; i++){ sum += list.get(i); } System.out.println(sum); } }