結果

問題 No.1084 積の積
ユーザー c-yanc-yan
提出日時 2020-07-30 04:51:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 356 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 10,700 KB
実行使用メモリ 18,976 KB
最終ジャッジ日時 2023-09-14 17:25:44
合計ジャッジ時間 8,229 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,920 KB
testcase_01 AC 15 ms
7,936 KB
testcase_02 AC 15 ms
7,796 KB
testcase_03 AC 16 ms
7,856 KB
testcase_04 AC 181 ms
9,900 KB
testcase_05 AC 147 ms
9,896 KB
testcase_06 AC 170 ms
9,820 KB
testcase_07 AC 15 ms
7,776 KB
testcase_08 AC 16 ms
7,852 KB
testcase_09 AC 288 ms
18,088 KB
testcase_10 AC 16 ms
7,796 KB
testcase_11 AC 27 ms
8,196 KB
testcase_12 AC 148 ms
12,668 KB
testcase_13 AC 296 ms
17,508 KB
testcase_14 AC 116 ms
11,416 KB
testcase_15 AC 108 ms
11,288 KB
testcase_16 AC 337 ms
18,976 KB
testcase_17 AC 138 ms
12,016 KB
testcase_18 AC 224 ms
15,016 KB
testcase_19 AC 295 ms
17,736 KB
testcase_20 AC 79 ms
10,060 KB
testcase_21 AC 118 ms
11,400 KB
testcase_22 AC 94 ms
10,660 KB
testcase_23 AC 190 ms
13,640 KB
testcase_24 AC 169 ms
13,296 KB
testcase_25 AC 303 ms
17,408 KB
testcase_26 AC 356 ms
18,712 KB
testcase_27 AC 351 ms
18,828 KB
testcase_28 AC 347 ms
18,676 KB
testcase_29 AC 346 ms
18,788 KB
testcase_30 AC 348 ms
18,816 KB
testcase_31 AC 347 ms
18,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,*A=(map(int,open(0).read().split()))
m=1000000007
l=0
a=1
b=1
x=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,-1,m)
        a//= A[l]
        l+=1
    x*=b
    x%=m
print(x)
0