結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー d07ki3bq1uzd07ki3bq1uz
提出日時 2019-09-27 23:00:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 975 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 2,009 ms
コンパイル使用メモリ 73,604 KB
実行使用メモリ 72,496 KB
最終ジャッジ日時 2023-10-25 05:38:19
合計ジャッジ時間 12,087 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
57,360 KB
testcase_01 AC 130 ms
57,500 KB
testcase_02 AC 131 ms
57,484 KB
testcase_03 AC 130 ms
57,556 KB
testcase_04 AC 129 ms
57,292 KB
testcase_05 AC 141 ms
55,628 KB
testcase_06 AC 199 ms
57,944 KB
testcase_07 AC 292 ms
61,624 KB
testcase_08 AC 505 ms
62,108 KB
testcase_09 AC 551 ms
62,000 KB
testcase_10 AC 869 ms
72,444 KB
testcase_11 AC 891 ms
72,372 KB
testcase_12 AC 898 ms
72,360 KB
testcase_13 AC 948 ms
72,432 KB
testcase_14 AC 953 ms
72,496 KB
testcase_15 AC 947 ms
72,400 KB
testcase_16 AC 975 ms
72,316 KB
testcase_17 AC 130 ms
57,380 KB
testcase_18 AC 133 ms
57,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Main {
    public static void main (String[] args) {
        
        Scanner sc = new Scanner(System.in);
        int c = sc.nextInt();
        long a = 0;
        
        for(int i = 0 ; i < c ; i++){
           long ans = sc.nextLong();
           a += ans; 
        }
        System.out.println(a);
    }
}
0