結果

問題 No.118 門松列(2)
ユーザー H3PO4H3PO4
提出日時 2020-04-28 00:52:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 155 ms / 5,000 ms
コード長 259 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 10,684 KB
実行使用メモリ 15,644 KB
最終ジャッジ日時 2023-08-14 18:26:32
合計ジャッジ時間 4,558 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 155 ms
8,576 KB
testcase_01 AC 132 ms
15,644 KB
testcase_02 AC 131 ms
15,040 KB
testcase_03 AC 131 ms
15,128 KB
testcase_04 AC 136 ms
15,524 KB
testcase_05 AC 133 ms
15,456 KB
testcase_06 AC 147 ms
8,476 KB
testcase_07 AC 146 ms
8,436 KB
testcase_08 AC 143 ms
8,392 KB
testcase_09 AC 130 ms
14,968 KB
testcase_10 AC 106 ms
9,836 KB
testcase_11 AC 107 ms
10,212 KB
testcase_12 AC 105 ms
9,532 KB
testcase_13 AC 102 ms
8,952 KB
testcase_14 AC 130 ms
14,824 KB
testcase_15 AC 103 ms
8,572 KB
testcase_16 AC 116 ms
12,092 KB
testcase_17 AC 102 ms
8,844 KB
testcase_18 AC 107 ms
10,260 KB
testcase_19 AC 112 ms
11,592 KB
testcase_20 AC 114 ms
11,516 KB
testcase_21 AC 124 ms
13,668 KB
testcase_22 AC 106 ms
9,828 KB
testcase_23 AC 121 ms
13,416 KB
testcase_24 AC 108 ms
10,600 KB
testcase_25 AC 112 ms
11,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
from collections import Counter

N = int(input())
A = Counter(map(int, input().split()))
lA = len(A)

MOD = 10 ** 9 + 7
ans = 0
for t in itertools.combinations(range(1, 101), 3):
    ans = (ans + A[t[0]] * A[t[1]] * A[t[2]]) % MOD
print(ans)
0