結果
問題 | No.1237 EXP Multiple! |
ユーザー |
👑 ![]() |
提出日時 | 2020-09-25 23:37:12 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 322 bytes |
コンパイル時間 | 345 ms |
コンパイル使用メモリ | 82,252 KB |
実行使用メモリ | 104,260 KB |
最終ジャッジ日時 | 2024-06-28 08:18:54 |
合計ジャッジ時間 | 22,771 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 WA * 2 RE * 4 |
ソースコード
from sys import stdinimport mathimport sysmod = 10**9+7N = int(input())A = list(map(int,stdin.readline().split()))now = 1for i in A:if i > 10 or now > 10**9+7:print (10**9+7)sys.exit()now *= i ** math.factorial(i)ans = mod % nowif ans == 0:print (-1)else:print (ans)