結果

問題 No.1237 EXP Multiple!
ユーザー daikisuyamadaikisuyama
提出日時 2020-09-26 11:10:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 305 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 87,304 KB
実行使用メモリ 104,820 KB
最終ジャッジ日時 2023-09-11 07:00:41
合計ジャッジ時間 3,845 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,496 KB
testcase_01 AC 109 ms
98,324 KB
testcase_02 AC 128 ms
100,088 KB
testcase_03 AC 127 ms
99,996 KB
testcase_04 AC 128 ms
99,392 KB
testcase_05 AC 106 ms
104,072 KB
testcase_06 AC 110 ms
103,928 KB
testcase_07 AC 106 ms
104,104 KB
testcase_08 AC 116 ms
104,692 KB
testcase_09 AC 108 ms
103,956 KB
testcase_10 AC 107 ms
104,036 KB
testcase_11 AC 109 ms
104,100 KB
testcase_12 AC 106 ms
103,944 KB
testcase_13 AC 111 ms
104,768 KB
testcase_14 AC 115 ms
104,632 KB
testcase_15 AC 111 ms
104,820 KB
testcase_16 AC 111 ms
104,808 KB
testcase_17 AC 110 ms
104,756 KB
testcase_18 AC 110 ms
104,768 KB
testcase_19 AC 106 ms
104,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
#ギャグ
mod=10**9+7
if max(a)>3:
    print(mod)
    exit()
if min(a)==0:
    print(-1)
    exit()
ans=1
for i in a:
    sub=1
    for j in range(i):
        sub*=(j+1)
    ans*=(i**sub)
    if ans>10**9+7:
        print(mod)
        exit()
print(mod%ans)
0