結果

問題 No.1237 EXP Multiple!
ユーザー hir355hir355
提出日時 2020-09-25 21:40:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 87,396 KB
実行使用メモリ 104,808 KB
最終ジャッジ日時 2023-09-10 17:22:34
合計ジャッジ時間 3,650 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,312 KB
testcase_01 AC 107 ms
97,988 KB
testcase_02 AC 126 ms
100,012 KB
testcase_03 AC 126 ms
99,844 KB
testcase_04 AC 128 ms
99,344 KB
testcase_05 AC 104 ms
104,036 KB
testcase_06 AC 104 ms
103,560 KB
testcase_07 AC 102 ms
103,708 KB
testcase_08 AC 108 ms
104,688 KB
testcase_09 AC 101 ms
103,648 KB
testcase_10 AC 101 ms
103,840 KB
testcase_11 AC 101 ms
103,716 KB
testcase_12 AC 107 ms
104,808 KB
testcase_13 AC 107 ms
104,612 KB
testcase_14 AC 107 ms
104,508 KB
testcase_15 AC 107 ms
104,804 KB
testcase_16 AC 106 ms
104,608 KB
testcase_17 AC 106 ms
104,452 KB
testcase_18 AC 108 ms
104,572 KB
testcase_19 AC 101 ms
103,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(-1)
else:
    ans = 1
    for x in a:
        if x >= 4:
            print(MOD)
            break
        f = 1
        for i in range(x):
            f *= (i + 1)
        for i in range(f):
            ans *= x
        if ans > MOD:
            print(MOD)
            break
    else:
        print(MOD % ans)
0