結果

問題 No.1237 EXP Multiple!
ユーザー NagisaNagisa
提出日時 2020-09-25 23:11:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 30,180 KB
最終ジャッジ日時 2023-09-10 16:12:20
合計ジャッジ時間 4,130 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
16,048 KB
testcase_01 AC 131 ms
23,836 KB
testcase_02 AC 148 ms
29,136 KB
testcase_03 AC 146 ms
30,180 KB
testcase_04 AC 150 ms
29,884 KB
testcase_05 AC 48 ms
12,172 KB
testcase_06 AC 120 ms
17,884 KB
testcase_07 AC 50 ms
12,120 KB
testcase_08 AC 192 ms
17,844 KB
testcase_09 AC 49 ms
12,272 KB
testcase_10 AC 49 ms
12,080 KB
testcase_11 AC 124 ms
17,844 KB
testcase_12 WA -
testcase_13 AC 182 ms
17,856 KB
testcase_14 AC 196 ms
17,840 KB
testcase_15 AC 188 ms
17,832 KB
testcase_16 AC 191 ms
17,940 KB
testcase_17 AC 187 ms
17,976 KB
testcase_18 AC 182 ms
17,860 KB
testcase_19 AC 51 ms
12,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9 + 7
N = int(input())
A = list(map(int,input().split()))
if 0 in A:
    print(-1)
    exit(0)

fac = [1 for k in range(200010)]
for k in range(2,200010):
    fac[k] = (fac[k-1]*k)%MOD

ans = 1
for e in A:
    if e > 10:
        print(MOD)
        exit(0)
    ans *= pow(e,fac[e],MOD)
    if ans > MOD:
        print(MOD)
        exit(0)
print(MOD%ans)
0