美丽元组
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.
Problem Description
给定, 定义使得 的 $(i, j)(1 \leq i \leq n,\ 1 \leq j \leq n,\ i \neq j)$为美丽元组, 求数组中美丽元组的个数
Input Format
第一行两个整数和
第二行个整数为数组的每个元素
Output Format
一行一个整数,表示美丽元组的个数
Sample
输入样例1
2 0
1 1
输出样例1
2
输入样例2
5 4
1 2 3 4 5
输出样例2
2
Hint
$1 \leq n \leq 10^5, \ 0 \leq k \leq 10^5,\ 1 \leq a[i] \leq 10^8,\ \Sigma{a[i]} \leq 10^8$
重庆邮电大学第十七届ACM程序设计大赛(网络赛)
- Status
- Done
- Rule
- XCPC
- Problem
- 11
- Start at
- 2024-3-9 0:00
- End at
- 2024-3-11 0:00
- Duration
- 48 hour(s)
- Host
- Partic.
- 1