結果

問題 No.1237 EXP Multiple!
ユーザー lloyzlloyz
提出日時 2022-02-06 00:13:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 30,684 KB
最終ジャッジ日時 2023-09-02 06:53:19
合計ジャッジ時間 3,262 ms
ジャッジサーバーID
(参考情報)
judge16 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,852 KB
testcase_01 AC 65 ms
23,780 KB
testcase_02 AC 85 ms
29,304 KB
testcase_03 AC 81 ms
30,256 KB
testcase_04 AC 88 ms
30,684 KB
testcase_05 AC 52 ms
11,428 KB
testcase_06 AC 55 ms
11,468 KB
testcase_07 AC 54 ms
11,312 KB
testcase_08 AC 134 ms
11,368 KB
testcase_09 AC 53 ms
11,416 KB
testcase_10 AC 51 ms
11,416 KB
testcase_11 AC 55 ms
11,420 KB
testcase_12 AC 55 ms
11,388 KB
testcase_13 AC 127 ms
11,372 KB
testcase_14 AC 124 ms
11,336 KB
testcase_15 AC 123 ms
11,500 KB
testcase_16 AC 122 ms
11,468 KB
testcase_17 AC 123 ms
11,480 KB
testcase_18 AC 125 ms
11,296 KB
testcase_19 AC 52 ms
11,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if min(A) == 0:
    print(-1)
elif max(A) >= 4:
    print(mod)
else:
    ans = 1
    Fact = [1, 1, 2, 6]
    for i in range(n):
        ans *= pow(A[i], Fact[A[i]])
        if ans > mod:
            break
    print(mod % ans)
0