E. 第5题-小美数匹配

第5题-小美数匹配

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

小美有 nn 个数,现在他想给 nn 个数两两配对,假设配对后为 (a,b),ab(a,b), a\leq b

现在他想问你,最多可以有多少不同的配对组合。

注意,(a,b)(a,b)(b,a)(b,a) 视为一种配对组合。

输入描述

第一行,一个整数 n(1n105)n(1 \leq n \leq 10^5) 表示数的数量。
第二行, nn 个整数,第 ii 个为 ai(1ai109)a_i(1 \leq a_i \leq 10^9)

输出描述

一个整数

样例

输入

8
1 1 2 2 2 2 3 3 

输出

说明

(1,2) (1,3) (2,3) (2,2)

秋招模拟赛第37场|2023.09.02-美团

Not Attended
Status
Done
Rule
IOI
Problem
5
Start at
2023-9-4 19:00
End at
2023-9-4 21:00
Duration
2 hour(s)
Host
Partic.
42