結果

問題 No.118 門松列(2)
ユーザー DialBirdDialBird
提出日時 2017-03-24 07:06:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 171 ms / 5,000 ms
コード長 382 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 10,532 KB
実行使用メモリ 21,060 KB
最終ジャッジ日時 2023-09-20 05:20:21
合計ジャッジ時間 5,423 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,548 KB
testcase_01 AC 171 ms
21,020 KB
testcase_02 AC 164 ms
20,616 KB
testcase_03 AC 160 ms
20,504 KB
testcase_04 AC 161 ms
21,060 KB
testcase_05 AC 163 ms
20,928 KB
testcase_06 AC 19 ms
8,500 KB
testcase_07 AC 19 ms
8,604 KB
testcase_08 AC 19 ms
8,464 KB
testcase_09 AC 159 ms
20,656 KB
testcase_10 AC 136 ms
19,940 KB
testcase_11 AC 133 ms
20,172 KB
testcase_12 AC 131 ms
19,912 KB
testcase_13 AC 133 ms
19,980 KB
testcase_14 AC 161 ms
21,000 KB
testcase_15 AC 131 ms
19,832 KB
testcase_16 AC 147 ms
20,512 KB
testcase_17 AC 130 ms
19,820 KB
testcase_18 AC 136 ms
20,088 KB
testcase_19 AC 144 ms
20,088 KB
testcase_20 AC 145 ms
20,028 KB
testcase_21 AC 160 ms
20,728 KB
testcase_22 AC 138 ms
20,028 KB
testcase_23 AC 151 ms
20,804 KB
testcase_24 AC 138 ms
20,084 KB
testcase_25 AC 143 ms
20,292 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.keys(), 3)):
    pat = take[a[0]] * take[a[1]] * take[a[2]]
    res += pat
    res %= devider

print(res)
0