結果

問題 No.1237 EXP Multiple!
ユーザー ntudantuda
提出日時 2022-03-13 22:26:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 288 bytes
コンパイル時間 1,757 ms
コンパイル使用メモリ 81,664 KB
実行使用メモリ 105,728 KB
最終ジャッジ日時 2023-10-19 09:52:18
合計ジャッジ時間 3,435 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,392 KB
testcase_01 AC 75 ms
93,992 KB
testcase_02 AC 86 ms
105,728 KB
testcase_03 AC 100 ms
101,328 KB
testcase_04 AC 95 ms
101,768 KB
testcase_05 AC 71 ms
95,676 KB
testcase_06 AC 73 ms
95,676 KB
testcase_07 AC 73 ms
95,676 KB
testcase_08 AC 77 ms
98,300 KB
testcase_09 AC 73 ms
95,676 KB
testcase_10 AC 73 ms
95,676 KB
testcase_11 AC 72 ms
95,676 KB
testcase_12 AC 76 ms
98,300 KB
testcase_13 AC 76 ms
98,300 KB
testcase_14 AC 77 ms
98,300 KB
testcase_15 AC 76 ms
98,300 KB
testcase_16 AC 78 ms
98,300 KB
testcase_17 AC 77 ms
98,300 KB
testcase_18 AC 76 ms
98,300 KB
testcase_19 AC 71 ms
95,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9+7
N = int(input())
A = list(map(int,input().split()))
f = [1,1,2,6]

if 0 in A:
    print(-1)
    exit()
ans = 1
for i in range(N):
    if A[i] > 3:
        print(MOD)
        exit()
    ans *= A[i] ** f[A[i]]
    if ans > MOD:
        print(MOD)
        exit()
print(MOD%ans)
0