結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー juugayajuugaya
提出日時 2020-06-12 23:07:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 789 ms / 3,000 ms
コード長 317 bytes
コンパイル時間 2,091 ms
コンパイル使用メモリ 71,472 KB
実行使用メモリ 69,264 KB
最終ジャッジ日時 2023-09-06 11:13:12
合計ジャッジ時間 10,567 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
56,008 KB
testcase_01 AC 113 ms
56,100 KB
testcase_02 AC 107 ms
55,636 KB
testcase_03 AC 108 ms
55,484 KB
testcase_04 AC 107 ms
55,896 KB
testcase_05 AC 126 ms
55,908 KB
testcase_06 AC 170 ms
58,540 KB
testcase_07 AC 237 ms
59,668 KB
testcase_08 AC 402 ms
59,740 KB
testcase_09 AC 472 ms
64,416 KB
testcase_10 AC 720 ms
67,076 KB
testcase_11 AC 764 ms
66,756 KB
testcase_12 AC 723 ms
66,772 KB
testcase_13 AC 754 ms
65,608 KB
testcase_14 AC 764 ms
66,924 KB
testcase_15 AC 785 ms
67,356 KB
testcase_16 AC 789 ms
69,264 KB
testcase_17 AC 110 ms
56,176 KB
testcase_18 AC 113 ms
55,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Sample {

public static void main(String args[]) {

Scanner scanner = new Scanner(System.in);

String input = scanner.nextLine();

int n=Integer.parseInt(input);
Long sum=0L;
for(int i =0;i<n;i++) {
String l =scanner.nextLine();
sum +=Long.parseLong(l);
}
System.out.println(sum); 
}}
0