結果

問題 No.1237 EXP Multiple!
ユーザー oevloevl
提出日時 2020-10-26 00:41:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 389 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 30,732 KB
最終ジャッジ日時 2023-09-29 02:24:16
合計ジャッジ時間 4,655 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,800 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 66 ms
11,936 KB
testcase_07 RE -
testcase_08 AC 102 ms
11,960 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 68 ms
12,016 KB
testcase_12 RE -
testcase_13 AC 104 ms
11,960 KB
testcase_14 AC 100 ms
11,912 KB
testcase_15 AC 105 ms
12,008 KB
testcase_16 AC 99 ms
12,016 KB
testcase_17 AC 105 ms
12,020 KB
testcase_18 AC 100 ms
11,940 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7

if any(va == 0 for va in a):
    print(-1)
if any(va > 3 for va in a):
    print(mod)

f = [1]
for i in range(3):
    f.append(f[-1] * (i + 1))
for i in range(len(f)):
    f[i] = pow(i, f[i])

ans = 1

for va in a:
    if ans > mod:
        print(mod)
        exit(0)
    else:
        ans *= f[va]

print(mod % ans)
0