結果
| 問題 |
No.118 門松列(2)
|
| ユーザー |
|
| 提出日時 | 2018-11-12 15:11:34 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 486 bytes |
| コンパイル時間 | 137 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 16,828 KB |
| 最終ジャッジ日時 | 2024-12-23 06:50:01 |
| 合計ジャッジ時間 | 3,194 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 23 |
ソースコード
import math
N = int(input())
l = list(map(int, input().split()))
s = set(l)
l_count = []
l.sort()
old_l_i = 0
count = 0
ans = 0
def combi(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
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:]
s = 1
for l_i in l_count:
s *= l_i
ans = combi(len(l_count), 3) * s
print(ans)