結果

問題 No.1237 EXP Multiple!
ユーザー KudeKude
提出日時 2020-09-25 22:48:39
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 104,444 KB
最終ジャッジ日時 2023-09-10 17:28:45
合計ジャッジ時間 3,756 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
70,760 KB
testcase_01 AC 109 ms
97,532 KB
testcase_02 AC 124 ms
99,716 KB
testcase_03 AC 123 ms
99,748 KB
testcase_04 AC 124 ms
99,188 KB
testcase_05 AC 102 ms
103,596 KB
testcase_06 AC 104 ms
103,596 KB
testcase_07 AC 103 ms
103,632 KB
testcase_08 AC 111 ms
104,216 KB
testcase_09 AC 104 ms
103,408 KB
testcase_10 AC 105 ms
103,300 KB
testcase_11 AC 104 ms
103,664 KB
testcase_12 AC 109 ms
104,044 KB
testcase_13 AC 111 ms
104,284 KB
testcase_14 AC 109 ms
104,016 KB
testcase_15 AC 110 ms
104,444 KB
testcase_16 AC 110 ms
104,064 KB
testcase_17 AC 109 ms
104,264 KB
testcase_18 AC 107 ms
104,068 KB
testcase_19 AC 104 ms
103,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

P = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(-1)
    exit()
now = 1
for x in a:
    x0 = x
    t = 1
    while x:
        t *= x
        if t > P:
            print(P)
            exit()
        x -= 1
    while t:
        now *= x0
        if now > P:
            print(P)
            exit()
        t -= 1
print(P % now)
0