結果

問題 No.1084 積の積
ユーザー c-yanc-yan
提出日時 2020-06-20 06:09:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 342 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 18,940 KB
最終ジャッジ日時 2023-09-16 16:47:03
合計ジャッジ時間 9,435 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,716 KB
testcase_01 AC 14 ms
7,844 KB
testcase_02 AC 14 ms
7,880 KB
testcase_03 WA -
testcase_04 AC 165 ms
9,876 KB
testcase_05 AC 138 ms
9,884 KB
testcase_06 AC 161 ms
10,068 KB
testcase_07 AC 14 ms
7,944 KB
testcase_08 AC 13 ms
7,872 KB
testcase_09 AC 354 ms
18,104 KB
testcase_10 AC 14 ms
7,796 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

l = 0
a = 1
b = 1
result = 1
for r in range(N):
    a *= A[r]
    b *= pow(A[r], r - l + 1, 1000000007)
    b %= 1000000007
    while a >= 1000000000:
        b *= pow(a, 1000000007 - 2, 1000000007)
        a //= A[r]
        l += 1
    result *= b
    result %= 1000000007
print(result)
0