結果

問題 No.1237 EXP Multiple!
ユーザー buey_tbuey_t
提出日時 2023-03-27 11:09:14
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 1,444 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 81,844 KB
実行使用メモリ 122,516 KB
最終ジャッジ日時 2023-10-19 14:02:28
合計ジャッジ時間 20,514 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
84,440 KB
testcase_01 AC 196 ms
112,020 KB
testcase_02 AC 208 ms
122,492 KB
testcase_03 AC 218 ms
122,516 KB
testcase_04 AC 185 ms
121,700 KB
testcase_05 RE -
testcase_06 AC 166 ms
116,464 KB
testcase_07 RE -
testcase_08 AC 162 ms
116,464 KB
testcase_09 RE -
testcase_10 WA -
testcase_11 AC 161 ms
116,468 KB
testcase_12 AC 163 ms
116,468 KB
testcase_13 AC 1,808 ms
116,284 KB
testcase_14 AC 1,797 ms
116,284 KB
testcase_15 AC 1,791 ms
116,284 KB
testcase_16 AC 1,807 ms
116,284 KB
testcase_17 AC 1,812 ms
116,284 KB
testcase_18 AC 1,841 ms
116,284 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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