結果
問題 | No.1096 Range Sums |
ユーザー |
|
提出日時 | 2020-12-18 06:51:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 296 bytes |
コンパイル時間 | 551 ms |
コンパイル使用メモリ | 65,792 KB |
最終ジャッジ日時 | 2025-01-17 02:47:57 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
#include <iostream>using namespace std;int main(){ios::sync_with_stdio(false);cin.tie(nullptr);int N;cin >> N;long long ans = 0, A;for(int i = 0; i < N; ++i){cin >> A;ans += A * (i + 1) * (N - i);}cout << ans << endl;return 0;}