結果

問題 No.118 門松列(2)
ユーザー takakintakakin
提出日時 2020-05-22 00:21:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 180 ms / 5,000 ms
コード長 226 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 16,680 KB
最終ジャッジ日時 2024-04-10 09:08:22
合計ジャッジ時間 5,054 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,752 KB
testcase_01 AC 177 ms
16,680 KB
testcase_02 AC 176 ms
16,488 KB
testcase_03 AC 180 ms
16,452 KB
testcase_04 AC 178 ms
16,656 KB
testcase_05 AC 171 ms
16,644 KB
testcase_06 AC 30 ms
10,880 KB
testcase_07 AC 30 ms
10,624 KB
testcase_08 AC 30 ms
10,624 KB
testcase_09 AC 172 ms
16,324 KB
testcase_10 AC 139 ms
11,904 KB
testcase_11 AC 140 ms
12,160 KB
testcase_12 AC 137 ms
11,520 KB
testcase_13 AC 138 ms
11,264 KB
testcase_14 AC 170 ms
16,112 KB
testcase_15 AC 132 ms
10,752 KB
testcase_16 AC 153 ms
13,892 KB
testcase_17 AC 138 ms
11,136 KB
testcase_18 AC 142 ms
12,288 KB
testcase_19 AC 148 ms
13,184 KB
testcase_20 AC 148 ms
13,440 KB
testcase_21 AC 162 ms
15,320 KB
testcase_22 AC 146 ms
11,904 KB
testcase_23 AC 159 ms
14,916 KB
testcase_24 AC 141 ms
12,544 KB
testcase_25 AC 148 ms
13,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
A=[int(i) for i in input().split()]
mod=10**9+7
import collections
C=collections.Counter(A)
ans=0
import itertools
for c1,c2,c3 in itertools.combinations(C.keys(),3):
  ans=(ans+C[c1]*C[c2]*C[c3])%mod
print(ans)
0