11401专题

UVA 11401 Triangle Counting

中文详解请访问我的博客:http://xiaoshig.sinaapp.com/?p=128 You are given n rods of length 1, 2…, n. You have to pick any 3 of them & build a triangle. How many distinct triangles can you make? Note that, two

uva 11401 - Triangle Counting(数论)

题目链接:uva 11401 - Triangle Counting 题目大意:有多少种方法可以从1,2,3...n中选出3个不同的数组成三角形,给出n,求种数。 解题思路:加法原理,设最大边为x的三角形有c(x)个,那么另外两条边长分别为y和z,根据三角形的形式可以的y+z>x,所以z的范围即为

UVa 11401 Triangle Counting (组合计数)

11401 - Triangle Counting Time limit: 1.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=469&page=show_problem&problem=2396 You are given n rods of leng

Uva - 11401 - Triangle Counting(数学推导)

题意:从1到n的整数中选出3个数来组成一个三角形,有几种组法。 题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=469&problem=2396 ——>>设 x + y > z, 则 x > z - y; 故z - y < x < z;