結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,936 KB
testcase_01 AC 16 ms
7,880 KB
testcase_02 AC 15 ms
7,928 KB
testcase_03 AC 16 ms
7,876 KB
testcase_04 WA -
testcase_05 AC 136 ms
9,804 KB
testcase_06 AC 160 ms
9,948 KB
testcase_07 AC 16 ms
7,820 KB
testcase_08 AC 16 ms
7,824 KB
testcase_09 AC 371 ms
17,936 KB
testcase_10 AC 15 ms
7,944 KB
testcase_11 AC 33 ms
8,124 KB
testcase_12 AC 218 ms
12,672 KB
testcase_13 AC 444 ms
17,424 KB
testcase_14 AC 169 ms
11,440 KB
testcase_15 AC 155 ms
11,144 KB
testcase_16 AC 505 ms
18,752 KB
testcase_17 AC 205 ms
12,052 KB
testcase_18 AC 334 ms
15,160 KB
testcase_19 AC 448 ms
17,628 KB
testcase_20 AC 111 ms
9,948 KB
testcase_21 AC 169 ms
11,696 KB
testcase_22 AC 133 ms
10,596 KB
testcase_23 AC 273 ms
13,936 KB
testcase_24 AC 248 ms
13,196 KB
testcase_25 AC 444 ms
17,780 KB
testcase_26 AC 507 ms
18,576 KB
testcase_27 AC 511 ms
18,472 KB
testcase_28 AC 509 ms
18,484 KB
testcase_29 AC 509 ms
18,524 KB
testcase_30 AC 508 ms
18,592 KB
testcase_31 AC 514 ms
18,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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