結果
問題 | No.1096 Range Sums |
ユーザー |
👑 ![]() |
提出日時 | 2020-10-04 12:28:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 323 bytes |
コンパイル時間 | 1,336 ms |
コンパイル使用メモリ | 167,564 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-19 08:15:00 |
合計ジャッジ時間 | 2,261 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
#include<bits/stdc++.h>using namespace std;using LL = long long;using ULL = unsigned long long;#define rep(i,n) for(int i=0; i<(n); i++)int N;LL A[200000];int main() {cin >> N;rep(i, N) cin >> A[i];LL ans = 0;rep(i, N) ans += A[i] * (i + 1) * (N - i);cout << ans << endl;return 0;}