Logo
(追記) (追記ここまで)

21147번 - Triangular Collection 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB73474568.182%

문제

Call a set of positive integers triangular if it has size at least three and, for all triples of distinct integers from the set, a triangle with those three integers as side lengths can be constructed.

Given a set of positive integers, compute the number of its triangular subsets.

입력

The first line of input contains a single integer $n$ (1ドル \le n \le 50$), which is the number of integers in the set.

Each of the the next $n$ lines contains a single integer $x$ (1ドル \le x \le 10^9$). These are the elements of the set. They are guaranteed to be distinct.

출력

Output a single integer, which is the number of triangular subsets of the given set.

제한

예제 입력 1

5
3
1
5
9
10

예제 출력 1

2

예제 입력 2

10
27
26
17
10
2
14
1
12
23
39

예제 출력 2

58

힌트

출처

ICPC > Regionals > North America > Southeast USA Regional > 2020 Southeast USA Regional Programming Contest N번

ICPC > Regionals > North America > Mid-Central Regional > 2020 Mid-Central Regional Programming Contest H번

ICPC > Regionals > North America > Pacific Northwest Regional > 2020 ICPC Pacific Northwest Region > Division 1 Q번

ICPC > Regionals > North America > Pacific Northwest Regional > 2020 ICPC Pacific Northwest Region > Division 2 AH번

ICPC > Regionals > North America > South Central USA Regional > 2020 South Central USA Regional Contest N번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /