結果

問題 No.1096 Range Sums
ユーザー tentententen
提出日時 2020-08-18 13:20:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 738 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 2,990 ms
コンパイル使用メモリ 74,184 KB
実行使用メモリ 52,076 KB
最終ジャッジ日時 2024-04-20 07:30:37
合計ジャッジ時間 8,516 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
41,404 KB
testcase_01 AC 134 ms
41,204 KB
testcase_02 AC 132 ms
41,552 KB
testcase_03 AC 131 ms
41,128 KB
testcase_04 AC 136 ms
41,228 KB
testcase_05 AC 134 ms
41,192 KB
testcase_06 AC 132 ms
41,348 KB
testcase_07 AC 131 ms
41,244 KB
testcase_08 AC 132 ms
41,304 KB
testcase_09 AC 130 ms
41,248 KB
testcase_10 AC 738 ms
51,236 KB
testcase_11 AC 715 ms
52,076 KB
testcase_12 AC 722 ms
51,356 KB
testcase_13 AC 688 ms
51,812 KB
testcase_14 AC 732 ms
51,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    static final int MOD = 1000000007;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long ans = 0;
        for (long i = 0; i < n; i++) {
            ans += (i + 1) * (n - i) * sc.nextInt();
        }
        System.out.println(ans);
    }
}
0