結果

問題 No.1237 EXP Multiple!
ユーザー MineMine
提出日時 2021-01-28 19:02:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 10,616 KB
実行使用メモリ 30,136 KB
最終ジャッジ日時 2023-09-08 10:12:03
合計ジャッジ時間 2,680 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,788 KB
testcase_01 AC 92 ms
23,780 KB
testcase_02 AC 123 ms
29,260 KB
testcase_03 AC 123 ms
30,136 KB
testcase_04 AC 83 ms
29,928 KB
testcase_05 AC 50 ms
12,180 KB
testcase_06 AC 50 ms
12,080 KB
testcase_07 AC 55 ms
12,240 KB
testcase_08 AC 50 ms
12,268 KB
testcase_09 AC 49 ms
12,104 KB
testcase_10 AC 54 ms
12,208 KB
testcase_11 AC 49 ms
12,148 KB
testcase_12 AC 49 ms
12,152 KB
testcase_13 AC 86 ms
12,080 KB
testcase_14 AC 86 ms
12,276 KB
testcase_15 AC 86 ms
12,148 KB
testcase_16 AC 87 ms
12,100 KB
testcase_17 AC 88 ms
12,156 KB
testcase_18 AC 86 ms
12,152 KB
testcase_19 AC 49 ms
12,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
moddehanai = 10**9 + 7
a.sort(reverse=True)
if a[0] >= 4:
    print(moddehanai)
elif a[-1] == 0:
    print(-1)
else:
    s = 1
    end = False
    for i in range(n):
        if a[i] == 3:
            s *= 3**6
        elif a[i] == 2:
            s *= 2**2
        if s > moddehanai:
            end = True
            print(moddehanai)
            break
    if not end:
        print(moddehanai % s)
0