結果

問題 No.1084 積の積
ユーザー c-yanc-yan
提出日時 2020-07-30 03:40:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 533 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 18,800 KB
最終ジャッジ日時 2023-09-14 03:07:56
合計ジャッジ時間 10,935 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,820 KB
testcase_01 AC 16 ms
7,788 KB
testcase_02 AC 16 ms
7,820 KB
testcase_03 AC 15 ms
7,772 KB
testcase_04 AC 187 ms
9,972 KB
testcase_05 AC 145 ms
9,904 KB
testcase_06 AC 166 ms
9,948 KB
testcase_07 AC 15 ms
7,840 KB
testcase_08 AC 16 ms
7,836 KB
testcase_09 AC 381 ms
18,176 KB
testcase_10 AC 16 ms
7,832 KB
testcase_11 AC 34 ms
8,288 KB
testcase_12 AC 224 ms
12,552 KB
testcase_13 AC 458 ms
17,372 KB
testcase_14 AC 172 ms
11,360 KB
testcase_15 AC 161 ms
11,312 KB
testcase_16 AC 522 ms
18,800 KB
testcase_17 AC 206 ms
12,132 KB
testcase_18 AC 337 ms
15,088 KB
testcase_19 AC 456 ms
17,784 KB
testcase_20 AC 116 ms
10,168 KB
testcase_21 AC 175 ms
11,532 KB
testcase_22 AC 138 ms
10,756 KB
testcase_23 AC 282 ms
13,856 KB
testcase_24 AC 257 ms
13,296 KB
testcase_25 AC 455 ms
17,628 KB
testcase_26 AC 526 ms
18,616 KB
testcase_27 AC 533 ms
18,500 KB
testcase_28 AC 524 ms
18,480 KB
testcase_29 AC 524 ms
18,612 KB
testcase_30 AC 526 ms
18,484 KB
testcase_31 AC 529 ms
18,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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