結果
問題 |
No.1096 Range Sums
|
ユーザー |
![]() |
提出日時 | 2020-06-26 22:02:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 491 bytes |
コンパイル時間 | 2,950 ms |
コンパイル使用メモリ | 191,312 KB |
最終ジャッジ日時 | 2025-01-11 11:28:51 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 WA * 5 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(v) (v).begin(), (v).end() using ll = long long; using P = pair<int, int>; constexpr int INF = 1e9; constexpr long long LINF = 1e18; constexpr long long MOD = 1e9 + 7; signed main() { int n; cin >> n; int a[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; }