Problem GTriangle Counting
Input: StandardInput
Output: StandardOutput
You are given n rods oflength 1, 2…, n. You have to pick any 3 of them & build a triangle. Howmany distinct triangles can you make? Note that, two triangles will beconsidered different if they have at least 1 pair of arms with differentlength.
Input
The input for each case will have only a single positive integern
<喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vc3Ryb25nPigzPD1uPD0xMDAwMDAwKS4gVGhlIGVuZCBvZmlucHV0IHdpbGwgYmUgaW5kaWNhdGVkIGJ5IGEgY2FzZSB3aXRoPHN0cm9uZz5uPC9zdHJvbmc+PDMuVGhpcyBjYXNlIHNob3VsZCBub3QgYmUgcHJvY2Vzc2VkLjwvcD4KPHA+PHN0cm9uZz5PdXRwdXQ8L3N0cm9uZz48L3A+CjxwPkZvciBlYWNoIHRlc3QgY2FzZSwgcHJpbnQgdGhlIG51bWJlciBvZiBkaXN0aW5jdCB0cmlhbmdsZXMgeW91IGNhbm1ha2UuPC9wPgo8cD48c3Ryb25nPlNhbXBsZSBJbnB1dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPdXRwdXQgZm9yIFNhbXBsZSBJbnB1dDwvc3Ryb25nPjwvcD4KPHRhYmxlIGJvcmRlcj0="1" cellspacing="0" cellpadding="0">
5 8 0 3 22 Problemsetter: Mohammad Mahmudur Rahman 每次做這種三角形的題的時候,我就想到了三角戀,然後就有一種想挖別人牆角的感覺,世界觀啊,情商啊,更年期啊。。。看電視劇的時候也是一樣,總是支持反派,這情況好像不太正常。。。。(飙淚中。。。) 代碼:
#include