結果

問題 No.118 門松列(2)
ユーザー nebukuro09nebukuro09
提出日時 2016-10-29 12:15:51
言語 Python2
(2.7.18)
結果
AC  
実行時間 180 ms / 5,000 ms
コード長 295 bytes
コンパイル時間 68 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-05-03 15:42:35
合計ジャッジ時間 4,696 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
6,784 KB
testcase_01 AC 169 ms
12,448 KB
testcase_02 AC 167 ms
12,388 KB
testcase_03 AC 178 ms
12,488 KB
testcase_04 AC 180 ms
12,428 KB
testcase_05 AC 173 ms
12,544 KB
testcase_06 AC 12 ms
6,656 KB
testcase_07 AC 11 ms
6,784 KB
testcase_08 AC 13 ms
6,656 KB
testcase_09 AC 172 ms
12,096 KB
testcase_10 AC 125 ms
7,936 KB
testcase_11 AC 129 ms
8,448 KB
testcase_12 AC 118 ms
7,296 KB
testcase_13 AC 116 ms
7,168 KB
testcase_14 AC 168 ms
12,012 KB
testcase_15 AC 111 ms
6,912 KB
testcase_16 AC 143 ms
9,728 KB
testcase_17 AC 116 ms
7,168 KB
testcase_18 AC 130 ms
8,448 KB
testcase_19 AC 138 ms
9,344 KB
testcase_20 AC 139 ms
9,472 KB
testcase_21 AC 157 ms
11,108 KB
testcase_22 AC 125 ms
8,064 KB
testcase_23 AC 153 ms
10,880 KB
testcase_24 AC 130 ms
8,576 KB
testcase_25 AC 136 ms
9,216 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