結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー ko kiko ki
提出日時 2020-12-29 22:21:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,078 ms / 3,000 ms
コード長 474 bytes
コンパイル時間 3,553 ms
コンパイル使用メモリ 75,928 KB
実行使用メモリ 57,760 KB
最終ジャッジ日時 2024-04-15 22:45:00
合計ジャッジ時間 14,953 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
41,044 KB
testcase_01 AC 135 ms
41,424 KB
testcase_02 AC 137 ms
41,400 KB
testcase_03 AC 136 ms
41,104 KB
testcase_04 AC 139 ms
41,032 KB
testcase_05 AC 149 ms
41,280 KB
testcase_06 AC 205 ms
42,316 KB
testcase_07 AC 302 ms
46,752 KB
testcase_08 AC 565 ms
47,772 KB
testcase_09 AC 701 ms
47,928 KB
testcase_10 AC 985 ms
57,760 KB
testcase_11 AC 1,041 ms
57,580 KB
testcase_12 AC 1,053 ms
57,632 KB
testcase_13 AC 1,046 ms
57,624 KB
testcase_14 AC 1,078 ms
57,612 KB
testcase_15 AC 1,059 ms
57,548 KB
testcase_16 AC 1,060 ms
57,532 KB
testcase_17 AC 135 ms
41,096 KB
testcase_18 AC 135 ms
41,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder_1 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);
    	
    	
        // int 1つ分を読み込む
        int a   = sc.nextInt();
    	long ans = 0;
    	
    	for(int i = 0; i < a; i++) {
    		long b   = sc.nextLong();
    		ans += b;
    		
    	}
    	System.out.println(ans);
    }
}
0