結果
| 問題 | No.1237 EXP Multiple! |
| コンテスト | |
| ユーザー |
buey_t
|
| 提出日時 | 2023-03-27 11:10:28 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,483 bytes |
| 記録 | |
| コンパイル時間 | 116 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 124,056 KB |
| 最終ジャッジ日時 | 2026-04-07 20:12:39 |
| 合計ジャッジ時間 | 12,293 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 18 TLE * 1 |
ソースコード
def main():
from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial,fsum
from heapq import heapify, heappop, heappush
from bisect import bisect_left, bisect_right
from copy import deepcopy
import copy
import random
from collections import deque,Counter,defaultdict
from itertools import permutations,combinations
from decimal import Decimal,ROUND_HALF_UP
#tmp = Decimal(mid).quantize(Decimal('0'), rounding=ROUND_HALF_UP)
from functools import lru_cache, reduce
#@lru_cache(maxsize=None)
from operator import add,sub,mul,xor,and_,or_,itemgetter
INF = 10**18
mod1 = 10**9+7
mod2 = 998244353
#DecimalならPython
#再帰ならPython!!!!!!!!!!!!!!!!!!!!!!!!!!
'''
1 2 2 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4...
10^9がえぐすぎるな
草
'''
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
if A[0] >= 4:
print(mod1)
elif A[-1] == 0:
print(-1)
else:
ans = 1
for i in range(N):
ans *= pow(A[i],factorial(A[i]))
if ans > mod1:
print(mod1)
exit()
print(mod1%ans)
if __name__ == '__main__':
main()
buey_t