結果
問題 | No.1096 Range Sums |
ユーザー |
![]() |
提出日時 | 2020-06-26 22:32:46 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 214 ms / 2,000 ms |
コード長 | 244 bytes |
コンパイル時間 | 123 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 23,212 KB |
最終ジャッジ日時 | 2024-07-04 22:17:14 |
合計ジャッジ時間 | 2,273 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
n = int(input())a_i = [int(x) for x in input().split()]cumulative_sum = [0]for i in range(n):cumulative_sum.append(cumulative_sum[i] + a_i[i])ans = 0for i in range(n + 1):ans += cumulative_sum[i] * (2 * i - n)print(ans)