結果
| 問題 |
No.1237 EXP Multiple!
|
| コンテスト | |
| ユーザー |
hiraku
|
| 提出日時 | 2020-10-27 09:54:48 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 395 bytes |
| コンパイル時間 | 141 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 33,276 KB |
| 最終ジャッジ日時 | 2024-07-21 21:52:11 |
| 合計ジャッジ時間 | 3,611 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 14 WA * 5 |
ソースコード
# No.1237 EXP Multiple!
# https://yukicoder.me/problems/no/1237
from math import factorial
def f(x):
return x ** factorial(x)
n = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7
if any(a == 0 for a in A):
print(0)
exit()
if any(a > 9 for a in A):
print(MOD)
exit()
ans = 1
for a in A:
if ans >= MOD:
print(MOD)
exit()
ans *= f(a)
print(MOD % ans)
hiraku