結果

問題 No.1237 EXP Multiple!
ユーザー yakeshibayakeshiba
提出日時 2021-03-07 04:55:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 328 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 107,520 KB
最終ジャッジ日時 2024-04-17 08:15:07
合計ジャッジ時間 2,664 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,840 KB
testcase_01 AC 97 ms
94,592 KB
testcase_02 AC 122 ms
107,520 KB
testcase_03 AC 132 ms
101,892 KB
testcase_04 AC 98 ms
102,144 KB
testcase_05 AC 73 ms
95,360 KB
testcase_06 AC 73 ms
95,488 KB
testcase_07 AC 81 ms
96,896 KB
testcase_08 AC 76 ms
96,128 KB
testcase_09 AC 75 ms
95,360 KB
testcase_10 AC 81 ms
97,152 KB
testcase_11 AC 76 ms
95,616 KB
testcase_12 AC 75 ms
96,000 KB
testcase_13 WA -
testcase_14 AC 76 ms
96,896 KB
testcase_15 AC 76 ms
96,384 KB
testcase_16 AC 76 ms
96,256 KB
testcase_17 AC 75 ms
96,128 KB
testcase_18 AC 76 ms
97,024 KB
testcase_19 AC 74 ms
95,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9+7
n = int(input())
A = list(map(int,input().split()))

prod = [1,4,3**6]

A.sort()

ans = 1
for a in A:
    if a == 0:
        print(-1)
        exit()
    if a >= 4:
        print(mod)
        exit()
    ans *= prod[a-1]
    if ans > mod:
        print(mod)
        exit()
    
print(mod%ans if mod%ans > 0 else -1)
0