結果

問題 No.1237 EXP Multiple!
ユーザー chineristACchineristAC
提出日時 2020-09-25 21:30:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 1,375 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 104,720 KB
最終ジャッジ日時 2023-09-10 17:21:45
合計ジャッジ時間 3,912 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,388 KB
testcase_01 AC 102 ms
97,984 KB
testcase_02 AC 124 ms
100,160 KB
testcase_03 AC 123 ms
100,076 KB
testcase_04 AC 120 ms
99,336 KB
testcase_05 AC 102 ms
103,868 KB
testcase_06 AC 101 ms
103,724 KB
testcase_07 AC 101 ms
103,776 KB
testcase_08 AC 107 ms
104,720 KB
testcase_09 AC 101 ms
103,708 KB
testcase_10 AC 101 ms
103,700 KB
testcase_11 AC 101 ms
103,664 KB
testcase_12 AC 104 ms
104,360 KB
testcase_13 AC 105 ms
104,368 KB
testcase_14 AC 105 ms
104,504 KB
testcase_15 AC 106 ms
104,548 KB
testcase_16 AC 105 ms
104,356 KB
testcase_17 AC 106 ms
104,472 KB
testcase_18 AC 105 ms
104,360 KB
testcase_19 AC 101 ms
103,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

g = [1,1,2,6]

N = int(input())
A = list(map(int,input().split()))

if 0 in A:
    print(-1)
else:
    res = 1
    for i in range(N):
        if A[i]>=4:
            exit(print(10**9+7))
        else:
            res *= pow(A[i],g[A[i]])
            if res >= 10**9+7:
                exit(print(10**9+7))
    print((10**9+7)%res)
0