結果
| 問題 | No.1237 EXP Multiple! |
| コンテスト | |
| ユーザー |
r_ishida
|
| 提出日時 | 2021-01-04 08:33:21 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 78 ms / 2,000 ms |
| + 902µs | |
| コード長 | 689 bytes |
| 記録 | |
| コンパイル時間 | 66 ms |
| コンパイル使用メモリ | 14,976 KB |
| 実行使用メモリ | 32,932 KB |
| 最終ジャッジ日時 | 2026-10-13 11:49:03 |
| 合計ジャッジ時間 | 3,751 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 20 |
ソースコード
import sys
import itertools
import math
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n = I()
a = LI()
if min(a) == 0:
print(-1)
elif max(a) >= 4:
print(10**9+7)
elif a.count(3) >= 4:
print(10**9+7)
elif a.count(2) >= 16:
print(10**9+7)
else:
ans = 1
for i in range(n):
if a[i] == 2:
ans *= 2**2
elif a[i] == 3:
ans *= 3**6
print((10**9+7)%ans)
r_ishida