結果
| 問題 |
No.118 門松列(2)
|
| ユーザー |
|
| 提出日時 | 2018-11-12 15:35:47 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 137 ms / 5,000 ms |
| コード長 | 500 bytes |
| コンパイル時間 | 126 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 16,664 KB |
| 最終ジャッジ日時 | 2024-12-23 07:23:40 |
| 合計ジャッジ時間 | 3,559 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 26 |
ソースコード
N = int(input())
l = list(map(int, input().split()))
s = set(l)
l_count = []
l.sort()
old_l_i = 0
count = 0
ans = 0
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:]
for i in range(len(l_count) - 2):
for j in range(i + 1, len(l_count) -1):
for k in range(j + 1, len(l_count)):
ans += l_count[i] * l_count[j] * l_count[k]
print(ans % 1000000007)