問題一覧 > 通常問題

No.856 Increasing Operations

レベル : / 実行時間制限 : 1ケース 3.153秒 / メモリ制限 : 315 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 23
作問者 : CuriousFairy315 / テスター : kakira9618
お気に入りにしたユーザー ProblemId : 2838 / 自分の提出
問題文最終更新日: 2022-10-09 14:28:06
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 218 (順位表) の他の問題:

Problem Statement

The fairy 31536000 likes things that make values grow, such as addition, multiplication, and exponentiation.
So she wrote down $N$ numbers and decided to compute with them according to the following rules.
First, for all $i$ and $j$ such that $i < j$, she multiplies together $(A_i + A_j) \cdot A_i^{A_j}$.
However, this value was a little too large, so she chose the smallest of the values $(A_i + A_j) \cdot A_i^{A_j}$ and divided by it, and the value became $M$.
Now, what was this $M$?
However, since the answer can be very large, output the remainder of $M$ divided by $1000000007$ instead of $M$.

Input

$N$
$A_1$ $\cdots$ $A_N$

$2 \leq N \leq 10^5$
$1 \leq A_i \leq 10^5$

Output

Find $\displaystyle \frac{\prod_{i=1}^{N} \prod_{j=i+1}^{N} (A_i + A_j) \cdot A_i^{A_j}}{\underset{i < j}{\min}((A_i + A_j) \cdot A_i^{A_j})} \mod 1000000007$.

Sample

Sample 1
Input
4
1 2 3 4
Output
43545600

$(1 + 2) \cdot 1^2 \cdot (1 + 3) \cdot 1^3 \cdot (1 + 4) \cdot 1^4 \cdot (2 + 3) \cdot 2^3 \cdot (2 + 4) \cdot 2^4 \cdot (3 + 4) \cdot 3^4 = 3 \cdot 4 \cdot 5 \cdot 40 \cdot 96 \cdot 567 = 130636800$.
The value divided by is $3$, so the answer is $130636800/ 3 = 43545600$.

Sample 2
Input
2
1000 1000
Output
1

$\frac{(1000 + 1000) \cdot 1000^{1000}}{(1000 + 1000) \cdot 1000^{1000}} = 1$.

Sample 3
Input
3
1 5 3
Output
6000

$\frac{(1+5) \cdot 1^5 \cdot (1+3) \cdot 1^3 \cdot (5+3) \cdot 5^3}{(1+3) \cdot 1^3}=6000$.

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