結果

問題 No.118 門松列(2)
ユーザー DialBirdDialBird
提出日時 2017-03-24 07:10:34
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 149 ms / 5,000 ms
コード長 362 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,572 KB
実行使用メモリ 21,024 KB
最終ジャッジ日時 2023-09-20 05:20:31
合計ジャッジ時間 4,133 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
8,572 KB
testcase_01 AC 149 ms
20,920 KB
testcase_02 AC 137 ms
20,576 KB
testcase_03 AC 143 ms
20,580 KB
testcase_04 AC 147 ms
20,912 KB
testcase_05 AC 142 ms
21,020 KB
testcase_06 AC 19 ms
8,448 KB
testcase_07 AC 19 ms
8,420 KB
testcase_08 AC 19 ms
8,484 KB
testcase_09 AC 138 ms
20,720 KB
testcase_10 AC 113 ms
20,048 KB
testcase_11 AC 115 ms
20,208 KB
testcase_12 AC 111 ms
19,848 KB
testcase_13 AC 111 ms
19,948 KB
testcase_14 AC 137 ms
21,024 KB
testcase_15 AC 107 ms
19,888 KB
testcase_16 AC 123 ms
20,504 KB
testcase_17 AC 110 ms
19,900 KB
testcase_18 AC 116 ms
20,148 KB
testcase_19 AC 120 ms
20,136 KB
testcase_20 AC 119 ms
20,080 KB
testcase_21 AC 128 ms
20,596 KB
testcase_22 AC 112 ms
20,044 KB
testcase_23 AC 127 ms
20,640 KB
testcase_24 AC 118 ms
20,180 KB
testcase_25 AC 117 ms
20,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
from itertools import combinations

N = int(input())
take = defaultdict(lambda: 0)
devider = 10**9 + 7

for i in [i for i in input().split()]:
    take[i] += 1

# len(take)が3未満でも0になる
res = 0
for a in list(combinations(take.values(), 3)):
    pat = a[0]*a[1]*a[2]
    res += pat
    res %= devider

print(res)
0