結果

問題 No.118 門松列(2)
ユーザー titiatitia
提出日時 2022-02-13 02:23:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 274 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 15,476 KB
最終ジャッジ日時 2023-09-11 15:12:26
合計ジャッジ時間 4,191 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,516 KB
testcase_01 AC 131 ms
15,476 KB
testcase_02 AC 130 ms
15,240 KB
testcase_03 AC 127 ms
15,348 KB
testcase_04 AC 128 ms
15,372 KB
testcase_05 AC 127 ms
15,296 KB
testcase_06 AC 18 ms
8,460 KB
testcase_07 AC 18 ms
8,488 KB
testcase_08 AC 18 ms
8,532 KB
testcase_09 AC 124 ms
14,960 KB
testcase_10 AC 102 ms
9,672 KB
testcase_11 AC 104 ms
9,984 KB
testcase_12 AC 101 ms
9,344 KB
testcase_13 AC 101 ms
8,856 KB
testcase_14 AC 125 ms
14,784 KB
testcase_15 AC 94 ms
8,596 KB
testcase_16 AC 112 ms
12,060 KB
testcase_17 AC 104 ms
8,892 KB
testcase_18 AC 106 ms
10,084 KB
testcase_19 AC 111 ms
11,500 KB
testcase_20 AC 114 ms
11,556 KB
testcase_21 AC 121 ms
13,768 KB
testcase_22 AC 105 ms
9,696 KB
testcase_23 AC 118 ms
13,124 KB
testcase_24 AC 108 ms
10,228 KB
testcase_25 AC 109 ms
11,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
from collections import Counter

C=Counter(A)

L=list(C.keys())

ANS=0

for i in range(len(L)):
    for j in range(i+1,len(L)):
        for k in range(j+1,len(L)):
            ANS+=C[L[i]]*C[L[j]]*C[L[k]]

print(ANS%(10**9+7))
0