【待完善】UVA - 11401:Triangle Counting

该博客介绍了UVA在线判题系统中的11401题——Triangle Counting。博客详细说明了问题内容,即给定n根长度为1到n的杆子,询问能组成多少种不同的三角形。输入是一个正整数n(3≤n≤1000000),当n<3时输入结束。对于每个测试用例,输出可能的不同三角形数量。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Triangle Counting

来源:UVA

标签:

参考资料:

相似题目:

题目

You are given n rods of length 1, 2, . . . , n. You have to pick any 3 of them and build a triangle. How many distinct triangles can you make? Note that, two triangles will be considered different if they have at least 1 pair of arms with different length.

输入

The input for each case will have only a single positive integer n (3 ≤ n ≤ 1000000). The end of input will be indicated by a case with n < 3. This case should not be processed.

输出

For each test case, print the num

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wingrez

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值