結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,960 KB
testcase_01 AC 65 ms
23,712 KB
testcase_02 AC 77 ms
29,328 KB
testcase_03 AC 76 ms
30,224 KB
testcase_04 AC 78 ms
30,728 KB
testcase_05 WA -
testcase_06 AC 50 ms
12,216 KB
testcase_07 WA -
testcase_08 AC 123 ms
12,220 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 50 ms
12,264 KB
testcase_12 WA -
testcase_13 AC 121 ms
12,204 KB
testcase_14 AC 123 ms
12,240 KB
testcase_15 AC 125 ms
12,124 KB
testcase_16 AC 121 ms
12,220 KB
testcase_17 AC 124 ms
12,208 KB
testcase_18 AC 122 ms
12,196 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import factorial
MOD = 10**9 + 7
N = int(input())
A = list(map(int,input().split()))

ans = 1
for e in A:
    if e > 10:
        print(MOD)
        exit(0)
    elif e != 0:
        ans *= pow(e,factorial(e),MOD)
    if ans > MOD:
        print(MOD)
        exit(0)

print(-1 if ans == 0 else MOD%ans)
0