結果

問題 No.1237 EXP Multiple!
ユーザー NagisaNagisa
提出日時 2020-09-25 23:27:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 364 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 30,320 KB
最終ジャッジ日時 2023-09-10 17:06:36
合計ジャッジ時間 3,762 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,036 KB
testcase_01 AC 64 ms
23,728 KB
testcase_02 AC 78 ms
29,232 KB
testcase_03 AC 76 ms
30,320 KB
testcase_04 AC 86 ms
29,856 KB
testcase_05 AC 48 ms
12,284 KB
testcase_06 AC 50 ms
12,288 KB
testcase_07 AC 48 ms
12,156 KB
testcase_08 AC 123 ms
12,320 KB
testcase_09 AC 48 ms
12,148 KB
testcase_10 AC 48 ms
12,176 KB
testcase_11 AC 50 ms
12,276 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 120 ms
12,160 KB
testcase_15 AC 127 ms
12,188 KB
testcase_16 AC 121 ms
12,212 KB
testcase_17 AC 120 ms
12,148 KB
testcase_18 AC 125 ms
12,204 KB
testcase_19 AC 50 ms
12,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import factorial
MOD = 10**9 + 7
N = int(input())
A = list(map(int,input().split()))
if 0 in A:
    print(-1)
    exit(0)
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)
if ans == 1:
    print(MOD)
else:
    print(MOD%ans)
0