結果
問題 | No.1237 EXP Multiple! |
ユーザー | lloyz |
提出日時 | 2022-02-06 00:11:19 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 299 bytes |
コンパイル時間 | 267 ms |
コンパイル使用メモリ | 86,920 KB |
実行使用メモリ | 111,512 KB |
最終ジャッジ日時 | 2023-09-02 06:53:08 |
合計ジャッジ時間 | 4,823 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge16 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 71 ms
75,828 KB |
testcase_01 | AC | 124 ms
98,264 KB |
testcase_02 | AC | 125 ms
100,120 KB |
testcase_03 | AC | 124 ms
100,476 KB |
testcase_04 | AC | 125 ms
99,352 KB |
testcase_05 | AC | 103 ms
104,072 KB |
testcase_06 | TLE | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
ソースコード
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 for i in range(n): cnt = 1 for j in range(1, A[i] + 1): cnt *= j ans *= pow(A[i], cnt) print(mod % ans)