結果

問題 No.1237 EXP Multiple!
ユーザー neterukunneterukun
提出日時 2020-09-25 22:02:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 403 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 104,756 KB
最終ジャッジ日時 2023-09-10 15:27:34
合計ジャッジ時間 3,599 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 103 ms
104,040 KB
testcase_06 WA -
testcase_07 AC 103 ms
103,860 KB
testcase_08 WA -
testcase_09 AC 102 ms
103,904 KB
testcase_10 AC 104 ms
104,072 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 103 ms
103,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fact = [1]
for i in range(1, 5):
    fact.append(fact[-1] * i)


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

if 0 in a:
    print(-1)
    exit()

flag = False
ans = 1
for val in a:
    if val > 4:
        flag = True
        break
    ans *= val ** fact[val]
    if ans > MOD:
        flag = True
        break
print(0 ** 1)
if flag:
    print(MOD)
else:
    print(MOD % ans)
0