結果

問題 No.1237 EXP Multiple!
ユーザー H3PO4H3PO4
提出日時 2020-09-25 22:55:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 215 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 30,712 KB
最終ジャッジ日時 2023-09-10 17:28:59
合計ジャッジ時間 3,579 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,696 KB
testcase_01 AC 64 ms
23,632 KB
testcase_02 AC 82 ms
29,572 KB
testcase_03 AC 81 ms
30,036 KB
testcase_04 AC 83 ms
30,712 KB
testcase_05 AC 51 ms
12,440 KB
testcase_06 AC 53 ms
12,428 KB
testcase_07 AC 52 ms
12,416 KB
testcase_08 AC 212 ms
12,440 KB
testcase_09 AC 51 ms
12,396 KB
testcase_10 AC 51 ms
12,504 KB
testcase_11 AC 52 ms
12,388 KB
testcase_12 AC 188 ms
12,428 KB
testcase_13 AC 211 ms
12,448 KB
testcase_14 AC 207 ms
12,448 KB
testcase_15 AC 215 ms
12,508 KB
testcase_16 AC 211 ms
12,500 KB
testcase_17 AC 211 ms
12,304 KB
testcase_18 AC 212 ms
12,428 KB
testcase_19 AC 53 ms
12,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = tuple(map(int, input().split()))
DIV = 10 ** 9 + 7

if 0 in A:
    print(-1)
    exit()


def excess(flag):
    if flag:
        print(DIV)
        exit()


ans = 1
for a in A:
    excess(a >= 4)
    tmp = 1
    for i in range(1, a + 1):
        tmp *= i
    ans *= a ** tmp
    excess(ans > DIV)
print(DIV % ans)
0