結果
問題 | No.1096 Range Sums |
ユーザー |
|
提出日時 | 2020-12-21 22:07:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 35 ms / 2,000 ms |
コード長 | 414 bytes |
コンパイル時間 | 1,599 ms |
コンパイル使用メモリ | 165,260 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-21 13:09:48 |
合計ジャッジ時間 | 3,140 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;#define mod 1000000007ll#define loop(i, n) for (int i = 0; i < n; i++)#define all(v) v.begin(), v.end()#define putout(a) cout << a << '\n'#define Sum(v) accumulate(all(v), 0ll)int main(){ll N, a, ans = 0;cin >> N;loop(i, N){cin >> a;ans += a * (1 + i) * (N - i);}putout(ans);return 0;}