結果

問題 No.1237 EXP Multiple!
ユーザー ibyiby
提出日時 2020-11-27 02:13:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 293 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 10,656 KB
実行使用メモリ 30,540 KB
最終ジャッジ日時 2023-10-01 03:50:12
合計ジャッジ時間 4,501 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,724 KB
testcase_01 AC 69 ms
23,568 KB
testcase_02 AC 84 ms
29,148 KB
testcase_03 AC 81 ms
30,056 KB
testcase_04 AC 82 ms
30,540 KB
testcase_05 AC 47 ms
12,048 KB
testcase_06 AC 55 ms
12,052 KB
testcase_07 AC 48 ms
11,980 KB
testcase_08 AC 160 ms
12,176 KB
testcase_09 AC 48 ms
12,020 KB
testcase_10 AC 48 ms
12,052 KB
testcase_11 AC 56 ms
12,004 KB
testcase_12 WA -
testcase_13 AC 161 ms
12,112 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 160 ms
12,068 KB
testcase_17 AC 162 ms
12,172 KB
testcase_18 AC 162 ms
12,168 KB
testcase_19 AC 56 ms
12,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9 + 7
n = int(input())
a = list(map(int, input().split()))
if any(v == 0 for v in a):
    print(-1)
    exit()

ans = 1
for v in a:
    for j in range(1, v + 1):
        ans = ans*(pow(v, j))
        if ans > MOD:
            print(MOD)
            exit()
else:
    print(MOD % ans)
0