結果
| 問題 | No.1096 Range Sums |
| コンテスト | |
| ユーザー |
a01sa01to
|
| 提出日時 | 2026-01-05 00:43:34 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 16 ms / 2,000 ms |
| コード長 | 427 bytes |
| 記録 | |
| コンパイル時間 | 3,439 ms |
| コンパイル使用メモリ | 336,224 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-01-05 00:43:38 |
| 合計ジャッジ時間 | 4,763 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int n;
cin >> n;
vector<ll> a(n);
rep(i, n) cin >> a[i];
// 1
// 2 2
// 3 4 3
// 4 6 6 4
// 5 8 9 8 5
ll ans = 0;
rep(i, n) ans += (ll) (i + 1) * (n - i) * a[i];
cout << ans << '\n';
return 0;
}
a01sa01to