結果

問題 No.118 門松列(2)
ユーザー masumasumath1masumasumath1
提出日時 2020-01-03 20:45:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 311 ms / 5,000 ms
コード長 302 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 16,692 KB
最終ジャッジ日時 2024-05-02 07:28:29
合計ジャッジ時間 5,969 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,752 KB
testcase_01 AC 306 ms
16,692 KB
testcase_02 AC 295 ms
16,372 KB
testcase_03 AC 300 ms
16,596 KB
testcase_04 AC 311 ms
16,664 KB
testcase_05 AC 301 ms
16,652 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 31 ms
10,752 KB
testcase_08 AC 31 ms
10,752 KB
testcase_09 AC 289 ms
16,332 KB
testcase_10 AC 147 ms
11,776 KB
testcase_11 AC 161 ms
12,160 KB
testcase_12 AC 134 ms
11,520 KB
testcase_13 AC 125 ms
11,136 KB
testcase_14 AC 286 ms
16,248 KB
testcase_15 AC 111 ms
10,752 KB
testcase_16 AC 207 ms
14,064 KB
testcase_17 AC 123 ms
11,136 KB
testcase_18 AC 158 ms
12,288 KB
testcase_19 AC 195 ms
13,312 KB
testcase_20 AC 197 ms
13,568 KB
testcase_21 AC 255 ms
15,336 KB
testcase_22 AC 149 ms
11,904 KB
testcase_23 AC 241 ms
14,808 KB
testcase_24 AC 162 ms
12,544 KB
testcase_25 AC 191 ms
13,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
mod = 10**9 + 7
N = int(input())
A = list(map(int,input().split()))
A.sort()
listA = [0 for _ in range(max(A)+1)]
setA = set(A)
for  a in setA:
    listA[a] = A.count(a)
ans = 0
for c in itertools.combinations(setA, 3):
    ans += listA[c[0]]*listA[c[1]]*listA[c[2]]%mod
print(ans%mod)
0