結果
| 問題 | 
                            No.1096 Range Sums
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-06-26 21:41:37 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 18 ms / 2,000 ms | 
| コード長 | 388 bytes | 
| コンパイル時間 | 763 ms | 
| コンパイル使用メモリ | 79,900 KB | 
| 最終ジャッジ日時 | 2025-01-11 11:06:29 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 12 | 
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
using namespace std;
typedef long long int ll;
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    vector<ll> a(n);
    ll res=0;
    for(ll i=0;i<n;i++){
        cin >> a[i];
        res+=(i+1)*(n-i)*a[i];
    }
    cout << res << endl;
}