結果

問題 No.1096 Range Sums
ユーザー srjywrdnprkt
提出日時 2024-03-06 00:02:25
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 1,906 ms
コンパイル使用メモリ 192,900 KB
最終ジャッジ日時 2025-02-20 01:10:03
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

    ll N, ans=0, A;
    cin >> N;
    for (int i=1; i<=N; i++){
        cin >> A;
        ans += A * (N-i+1) * i;
    }

    cout << ans << '\n';

    return 0;
}
0