結果

問題 No.1096 Range Sums
ユーザー vjudge1
提出日時 2025-08-21 00:26:11
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 433 bytes
コンパイル時間 3,389 ms
コンパイル使用メモリ 170,844 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-08-21 00:26:18
合計ジャッジ時間 4,692 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long 
const int maxn = 2e5 + 5;
const int inf = 1e18;
const int base = 31;
const int mod = 1e9 + 7;
const int mod2 = 1212121;
using namespace std;
int n;
int res = 0;
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for(int i = 1; i <= n; i++) {
        int x;
        cin >> x;
        res += x * (n - i + 1) * i;
    }
    cout << res << "\n";
}
0