問題一覧 > 通常問題

No.797 Noel-chan and the Pyramid

レベル : / AI推定難易度 : 800 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 262
作問者 : polylogK / テスター : Kutimoti_T
お気に入りにしたユーザー ProblemId : 2104 / 自分の提出
問題文最終更新日: 2019-03-18 00:25:57
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 207 (順位表) の他の問題:

Problem Statement

One day, Noel-chan found a sequence of length $N$. She considers the following operation on this sequence.

  • Arrange the sums of adjacent numbers in order to create a new sequence of length $N - 1$.
Repeating this, the length eventually becomes $1$. Find the element of the final sequence.

Input

$N$
$a_1\ \ a_2\ \cdots\ a_{N-1}\ \ a_N$

The first line contains the length $N(1\le N\le 10^5)$ of the original sequence.
The second line contains the elements $a_i(0\le a_i\le 10^9)$ of the original sequence, separated by spaces.

Output

Output the element of the final sequence modulo $10^9+7$ on a single line.

Sample

Sample 1
Input
5
1 2 3 4 5
Output
48

The transitions of the sequence are shown in order.

1. 1 2 3 4 5
2. 3 5 7 9
3. 8 12 16
4. 20 28
5. 48
Sample 2
Input
11
1 3 3 3 5 7 5 3 3 3 1
Output
4916
Sample 3
Input
15
63 93 23 32 87 15 32 19 57 43 47 95 51 93 13
Output
638367

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。