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

33749번 - Inequality Satisfying Subsequences 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 2048 MB222100.000%

문제

A sequence of three positive integers $[a, b, c]$ is called a triangle if $a+b>c$ holds when reordered such that $a \leq b \leq c$.

A sequence of positive integers is triangle-free if no subsequence of length 3ドル$ forms a triangle.

Given a sequence of positive integers $L,ドル count how many non-empty subsequences of $L$ are triangle-free. As the answer may be very large, you are only required to find the value modulo 998ドル ,円 244 ,円 353$.

입력

The first line contains a single integer $n$ (1ドル \leq n \leq 7,000円$) --- the size of the input sequence.

The second line contains $n$ integers $L_1, L_2, \cdots, L_n$ (1ドル \leq L_i \leq 10^9$) --- the elements of the sequence $L$.

출력

Output the number of non-empty triangle-free subsequences modulo 998ドル ,円 244 ,円 353$ on one line.

제한

예제 입력 1

10
1 2 3 4 5 6 7 8 9 10

예제 출력 1

173

예제 입력 2

6
9 6 7 8 4 4

예제 출력 2

23

예제 입력 3

10
1 3 9 27 81 243 729 2187 6561 19683

예제 출력 3

1023

힌트

출처

Camp > Osijek Competitive Programming Camp > Summer 2024 > Day 5: OCPC Potluck Contest 2 I번

  • 문제를 만든 사람: dnialh
(追記) (追記ここまで)

출처

대학교 대회

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

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