結果

問題 No.1084 積の積
ユーザー ああいいああいい
提出日時 2022-02-23 14:04:45
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 427 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 91,732 KB
最終ジャッジ日時 2023-09-14 06:15:33
合計ジャッジ時間 7,510 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,280 KB
testcase_01 AC 70 ms
71,188 KB
testcase_02 AC 67 ms
71,108 KB
testcase_03 AC 71 ms
70,944 KB
testcase_04 AC 240 ms
89,800 KB
testcase_05 RE -
testcase_06 AC 203 ms
89,308 KB
testcase_07 RE -
testcase_08 AC 69 ms
71,312 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 85 ms
76,728 KB
testcase_12 AC 124 ms
82,128 KB
testcase_13 AC 168 ms
89,816 KB
testcase_14 AC 110 ms
79,500 KB
testcase_15 AC 109 ms
79,460 KB
testcase_16 AC 182 ms
91,732 KB
testcase_17 AC 121 ms
81,412 KB
testcase_18 AC 147 ms
86,456 KB
testcase_19 AC 170 ms
89,576 KB
testcase_20 AC 100 ms
77,448 KB
testcase_21 AC 110 ms
79,572 KB
testcase_22 AC 101 ms
78,364 KB
testcase_23 AC 132 ms
83,968 KB
testcase_24 AC 129 ms
82,796 KB
testcase_25 AC 171 ms
89,760 KB
testcase_26 AC 190 ms
90,288 KB
testcase_27 AC 187 ms
90,284 KB
testcase_28 AC 188 ms
90,296 KB
testcase_29 AC 188 ms
90,352 KB
testcase_30 AC 189 ms
90,300 KB
testcase_31 AC 192 ms
90,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
P = 10 ** 9 + 7
ans = 1
souseki = 1
seki = 1
right = 0
for left in range(N):
    while right < N and seki * A[right] < 10 ** 9:
        seki *= A[right]
        souseki = souseki * seki % P
        right += 1
    ans = ans * souseki % P
    inv = pow(A[left],P-2,P)
    seki = seki // A[left]
    delta = right - left
    souseki = souseki * pow(inv,right-left,P)
print(ans)
0