結果

問題 No.118 門松列(2)
ユーザー ssmkzkssmkzk
提出日時 2018-11-12 15:35:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 500 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,744 KB
実行使用メモリ 15,976 KB
最終ジャッジ日時 2023-08-24 21:20:59
合計ジャッジ時間 3,451 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,224 KB
testcase_01 AC 118 ms
15,976 KB
testcase_02 AC 119 ms
15,172 KB
testcase_03 AC 114 ms
15,160 KB
testcase_04 AC 118 ms
15,896 KB
testcase_05 AC 114 ms
15,408 KB
testcase_06 AC 16 ms
7,860 KB
testcase_07 AC 15 ms
7,724 KB
testcase_08 AC 16 ms
7,848 KB
testcase_09 AC 114 ms
14,840 KB
testcase_10 AC 72 ms
9,824 KB
testcase_11 AC 75 ms
10,252 KB
testcase_12 AC 72 ms
9,112 KB
testcase_13 AC 68 ms
8,696 KB
testcase_14 AC 115 ms
14,744 KB
testcase_15 AC 62 ms
8,176 KB
testcase_16 AC 89 ms
11,820 KB
testcase_17 AC 68 ms
8,624 KB
testcase_18 AC 80 ms
10,164 KB
testcase_19 AC 86 ms
11,300 KB
testcase_20 AC 85 ms
11,636 KB
testcase_21 AC 103 ms
13,620 KB
testcase_22 AC 72 ms
9,764 KB
testcase_23 AC 99 ms
13,332 KB
testcase_24 AC 75 ms
10,500 KB
testcase_25 AC 86 ms
11,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
l = list(map(int, input().split()))
s = set(l)
l_count = []
l.sort()
old_l_i = 0
count = 0
ans = 0

for l_i in l:
    if old_l_i == l_i:
        count += 1
    else:
        l_count.append(count)
        count = 1
    old_l_i = l_i

l_count.append(count)
l_count = l_count[1:]


for i in range(len(l_count) - 2):
    for j in range(i + 1, len(l_count) -1):
        for k in range(j + 1, len(l_count)):
            ans += l_count[i] * l_count[j] * l_count[k]

print(ans % 1000000007)
0