結果

問題 No.118 門松列(2)
ユーザー steek79steek79
提出日時 2015-11-19 01:04:40
言語 Python2
(2.7.18)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 303 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 12,228 KB
最終ジャッジ日時 2024-04-17 13:10:30
合計ジャッジ時間 3,311 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,528 KB
testcase_01 AC 133 ms
12,128 KB
testcase_02 AC 135 ms
12,064 KB
testcase_03 AC 140 ms
12,160 KB
testcase_04 AC 133 ms
12,228 KB
testcase_05 AC 138 ms
12,224 KB
testcase_06 AC 11 ms
6,400 KB
testcase_07 AC 11 ms
6,272 KB
testcase_08 AC 11 ms
6,272 KB
testcase_09 AC 127 ms
11,900 KB
testcase_10 AC 87 ms
7,680 KB
testcase_11 AC 93 ms
8,064 KB
testcase_12 AC 87 ms
7,296 KB
testcase_13 AC 81 ms
6,912 KB
testcase_14 AC 126 ms
11,812 KB
testcase_15 AC 73 ms
6,528 KB
testcase_16 AC 103 ms
9,588 KB
testcase_17 AC 79 ms
6,912 KB
testcase_18 AC 89 ms
8,064 KB
testcase_19 AC 100 ms
8,960 KB
testcase_20 AC 104 ms
9,216 KB
testcase_21 AC 124 ms
10,880 KB
testcase_22 AC 89 ms
7,680 KB
testcase_23 AC 115 ms
10,496 KB
testcase_24 AC 92 ms
8,320 KB
testcase_25 AC 99 ms
8,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

N = input()
A = map(int, raw_input().split())
MOD = 10**9+7

dic = dict()
for a in A:
    dic[a] = dic.get(a, 0) + 1

uniq = list(set(A))
combs = itertools.combinations(uniq, 3)
ans = 0

for comb in combs:
    n = dic[comb[0]] * dic[comb[1]] * dic[comb[2]]
    ans += n

print ans%MOD
0