OJ/3834/5/5.txt
2025-01-14 20:19:17 +08:00

26 lines
782 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

三角形牧场
内存限制128 MB
时间限制3.000 S
评测方式:文本比较
命题人admin
提交580
解决94
题目描述
和所有人一样奶牛喜欢变化。它们正在设想新造型的牧场。奶牛建筑师John想建造围有漂亮白色栅栏的三角形牧场。
他拥有 n 块木板,每块的长度 A_i 都是整数。
他想要选三块木板,使得它们的长度能够构成一个三角形,请问有多少种选择方法呢?
输入
第一行,一个整数,代表 (3 \leq n \leq 2 \times 10^3)
第二行n 个整数,代表(1 \leq A_i \leq 10^3)
输出
输出一个整数,代表方案数
样例输入 复制
5
1 2 3 4 3
样例输出 复制
5
提示
样例解释:共五种方案:
(1,3,3),(2,3,3),(2,3,4)^{有两个},(3,3,4)