結果

問題 No.1237 EXP Multiple!
ユーザー hirakuhiraku
提出日時 2020-10-27 09:54:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 30,756 KB
最終ジャッジ日時 2023-09-29 03:12:43
合計ジャッジ時間 3,293 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,864 KB
testcase_01 AC 74 ms
23,904 KB
testcase_02 AC 88 ms
29,292 KB
testcase_03 AC 85 ms
30,280 KB
testcase_04 AC 87 ms
30,756 KB
testcase_05 WA -
testcase_06 AC 68 ms
12,124 KB
testcase_07 WA -
testcase_08 AC 125 ms
12,192 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 69 ms
12,188 KB
testcase_12 AC 109 ms
12,312 KB
testcase_13 AC 116 ms
12,116 KB
testcase_14 AC 115 ms
12,332 KB
testcase_15 AC 116 ms
12,288 KB
testcase_16 AC 116 ms
12,272 KB
testcase_17 AC 116 ms
12,184 KB
testcase_18 AC 117 ms
12,144 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# 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)
0