中文详解请访问我的博客: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
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
题意:从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;