結果
| 問題 |
No.118 門松列(2)
|
| ユーザー |
|
| 提出日時 | 2024-09-29 19:11:53 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 297 bytes |
| コンパイル時間 | 547 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 16,864 KB |
| 最終ジャッジ日時 | 2024-09-29 19:12:00 |
| 合計ジャッジ時間 | 5,363 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 21 |
ソースコード
import itertools
n = int(input())
a = list(map(int, input().split()))
d = [0 for _ in range(max(a)+1)]
set_a = set(a)
mod = 10 ** 9 + 7
for i in set_a:
d[i] = a.count(i)
ans = 0
for c in itertools.combinations(set_a, 3):
ans += (d[c[0]] * d[c[1]] * d[c[2]]) % mod
print(ans)