結果

問題 No.1237 EXP Multiple!
ユーザー takakintakakin
提出日時 2020-10-24 12:45:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 30,128 KB
最終ジャッジ日時 2023-09-28 20:23:04
合計ジャッジ時間 3,005 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,804 KB
testcase_01 AC 71 ms
23,696 KB
testcase_02 AC 88 ms
29,168 KB
testcase_03 AC 87 ms
30,128 KB
testcase_04 AC 93 ms
29,848 KB
testcase_05 AC 62 ms
12,212 KB
testcase_06 AC 62 ms
12,044 KB
testcase_07 AC 63 ms
12,052 KB
testcase_08 AC 117 ms
12,076 KB
testcase_09 AC 62 ms
12,176 KB
testcase_10 AC 63 ms
12,128 KB
testcase_11 AC 63 ms
12,116 KB
testcase_12 AC 59 ms
12,128 KB
testcase_13 AC 118 ms
12,168 KB
testcase_14 AC 114 ms
12,100 KB
testcase_15 AC 114 ms
12,052 KB
testcase_16 AC 114 ms
12,176 KB
testcase_17 AC 114 ms
12,176 KB
testcase_18 AC 118 ms
12,192 KB
testcase_19 AC 62 ms
12,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
A=[int(i) for i in input().split()]
mod=10**9+7
if max(A)>=4:
	print(mod)
elif min(A)==0:
	print(-1)
else:
	F=[1,1,2,6]
	cur=1
	for a in A:
		cur*=pow(a,F[a])
		if cur>mod:
			print(mod)
			break
	else:
		print(mod%cur)
0