結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー Ryota EnokidoRyota Enokido
提出日時 2018-12-09 20:05:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 935 ms / 2,000 ms
コード長 356 bytes
コンパイル時間 2,703 ms
コンパイル使用メモリ 71,352 KB
実行使用メモリ 66,244 KB
最終ジャッジ日時 2023-10-14 21:48:34
合計ジャッジ時間 12,735 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,724 KB
testcase_01 AC 129 ms
55,432 KB
testcase_02 AC 127 ms
55,732 KB
testcase_03 AC 126 ms
55,632 KB
testcase_04 AC 128 ms
55,424 KB
testcase_05 AC 138 ms
55,652 KB
testcase_06 AC 184 ms
56,636 KB
testcase_07 AC 278 ms
60,172 KB
testcase_08 AC 460 ms
60,352 KB
testcase_09 AC 575 ms
61,236 KB
testcase_10 AC 871 ms
64,492 KB
testcase_11 AC 844 ms
66,244 KB
testcase_12 AC 863 ms
65,896 KB
testcase_13 AC 901 ms
65,172 KB
testcase_14 AC 893 ms
64,884 KB
testcase_15 AC 898 ms
64,632 KB
testcase_16 AC 935 ms
64,568 KB
testcase_17 AC 127 ms
55,812 KB
testcase_18 AC 128 ms
55,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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