結果

問題 No.118 門松列(2)
ユーザー nebukuro09nebukuro09
提出日時 2016-10-29 12:15:51
言語 Python2
(2.7.18)
結果
AC  
実行時間 180 ms / 5,000 ms
コード長 295 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 7,116 KB
実行使用メモリ 12,128 KB
最終ジャッジ日時 2023-08-16 06:36:36
合計ジャッジ時間 5,577 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
6,676 KB
testcase_01 AC 180 ms
12,036 KB
testcase_02 AC 177 ms
11,752 KB
testcase_03 AC 177 ms
11,944 KB
testcase_04 AC 175 ms
12,128 KB
testcase_05 AC 177 ms
12,076 KB
testcase_06 AC 12 ms
6,416 KB
testcase_07 AC 13 ms
6,440 KB
testcase_08 AC 14 ms
6,440 KB
testcase_09 AC 174 ms
11,620 KB
testcase_10 AC 128 ms
7,456 KB
testcase_11 AC 131 ms
7,916 KB
testcase_12 AC 123 ms
7,168 KB
testcase_13 AC 119 ms
6,620 KB
testcase_14 AC 174 ms
11,596 KB
testcase_15 AC 116 ms
6,584 KB
testcase_16 AC 148 ms
9,360 KB
testcase_17 AC 121 ms
6,936 KB
testcase_18 AC 133 ms
7,828 KB
testcase_19 AC 144 ms
9,008 KB
testcase_20 AC 146 ms
9,032 KB
testcase_21 AC 164 ms
10,824 KB
testcase_22 AC 129 ms
7,452 KB
testcase_23 AC 159 ms
10,584 KB
testcase_24 AC 133 ms
8,020 KB
testcase_25 AC 142 ms
8,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
N = input()
A = map(int, raw_input().split())
C = Counter(A)
M = len(C.keys())
K = C.keys()
MOD = 10**9+7

ans = 0
for i in xrange(M):
    for j in xrange(i+1, M):
        for k in xrange(j+1, M):
            ans = (ans + C[K[i]]*C[K[j]]*C[K[k]]) % MOD
print ans
0