結果

問題 No.1096 Range Sums
ユーザー vjudge1
提出日時 2025-08-20 22:12:49
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 2,727 ms
コンパイル使用メモリ 274,168 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-08-20 22:12:52
合計ジャッジ時間 3,488 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
#define int long long
int n;
int a[200005];
signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cin >> n;
    for(int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    int res = 0;
    for(int i = 1; i <= n; i++) {
        res += a[i] * (n - i + 1) * i;
    }
    cout << res;
    return 0;
}
0