結果

問題 No.1237 EXP Multiple!
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2020-09-25 23:44:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 190 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 30,676 KB
最終ジャッジ日時 2023-09-10 17:31:10
合計ジャッジ時間 3,367 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,844 KB
testcase_01 AC 63 ms
23,612 KB
testcase_02 AC 78 ms
29,300 KB
testcase_03 AC 77 ms
30,088 KB
testcase_04 AC 83 ms
30,676 KB
testcase_05 AC 49 ms
12,120 KB
testcase_06 AC 51 ms
12,236 KB
testcase_07 AC 50 ms
12,168 KB
testcase_08 AC 190 ms
12,104 KB
testcase_09 AC 49 ms
12,012 KB
testcase_10 AC 48 ms
12,052 KB
testcase_11 AC 51 ms
12,052 KB
testcase_12 AC 168 ms
12,104 KB
testcase_13 AC 181 ms
12,164 KB
testcase_14 AC 179 ms
12,144 KB
testcase_15 AC 188 ms
12,092 KB
testcase_16 AC 182 ms
12,220 KB
testcase_17 AC 181 ms
12,172 KB
testcase_18 AC 182 ms
12,064 KB
testcase_19 AC 50 ms
12,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))
if 0 in a:
    print(-1)
    exit()
mod = 10**9+7
count = 1
for i in a:
    if i >= 4:
        print(mod)
        exit()
    x = 1
    for j in range(1,i+1):
        x *= j
    count *= pow(i,x)
    if count > mod:
        print(mod)
        exit()
print(mod%count) 
0