結果
問題 | No.1237 EXP Multiple! |
ユーザー | 👑 SPD_9X2 |
提出日時 | 2020-09-25 23:36:40 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 311 bytes |
コンパイル時間 | 495 ms |
コンパイル使用メモリ | 87,216 KB |
実行使用メモリ | 105,024 KB |
最終ジャッジ日時 | 2023-09-10 17:10:35 |
合計ジャッジ時間 | 5,184 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 72 ms
71,368 KB |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | RE | - |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | RE | - |
testcase_11 | RE | - |
testcase_12 | RE | - |
testcase_13 | WA | - |
testcase_14 | AC | 111 ms
104,344 KB |
testcase_15 | AC | 110 ms
104,324 KB |
testcase_16 | AC | 110 ms
104,300 KB |
testcase_17 | AC | 112 ms
104,368 KB |
testcase_18 | AC | 111 ms
104,424 KB |
testcase_19 | RE | - |
ソースコード
from sys import stdin import math mod = 10**9+7 N = int(input()) A = list(map(int,stdin.readline().split())) now = 1 for i in A: if i > 10 or now > 10**9+7: print (10**9+7) sys.exit() now *= i ** math.factorial(i) ans = mod % now if ans == 0: print (-1) else: print (ans)