結果

問題 No.1096 Range Sums
ユーザー onsen_manjuuuonsen_manjuuu
提出日時 2020-07-05 09:09:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 3,086 ms
コンパイル使用メモリ 168,632 KB
実行使用メモリ 4,864 KB
最終ジャッジ日時 2023-10-22 02:08:29
合計ジャッジ時間 4,457 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
using ll = long long;


int main()
{
    int n;
    cin >> n;

    vector<ll> a(n);
    for(int i = 0; i < n; i++)cin >> a[i];

    ll sum = 0;
    for(int i = 0; i < n; i++) {
        ll cur = (i + 1) * (n - i);
        sum += a[i] * cur;
    }
    cout << sum << endl;
}

// 1 2 3 4
0