[BOJ 15449] Art
View as PDF
Submit solution
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text
Points:
1
Time limit:
2.0s
Memory limit:
512M
Problem types
Allowed languages
Vera has five sticks of distinct lengths l1, l2, l3, l4, l5. Vera may choose any three of the five sticks to form the sides of a triangle. How many different triangles can Vera make? Each triangle must have positive area and sticks cannot be bent or cut.
입력 형식
Line 1 contains integers l1, l2, l3, l4, l5 (1 ≤ li ≤ 1000).
출력 형식
Print one line with one integer, the number of ways to form a triangle.
예제 입력 1
1 2 3 4 5
예제 출력 1
3
예제 입력 2
1 2 4 8 16
예제 출력 2
0
힌트
For the first example, the 3 ways to form a triangle are choosing sticks 2, 3, 4 or 2, 4, 5 or 3, 4, 5.
Comments