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

10092번 - Decreasing Sequences of Points 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB154450.000%

문제

Let A1 (x1, y1), A2 (x2, y2), ..., An (xn, yn) be a sequence of n different points in the plane with nonnegative integer coordinates. We call this sequence decreasing if for any two points Ai (xi, yi) and Ai+1 (xi+1, yi+1), it is true that xi ≤ xi+1 and yi ≥ yi+1. For example, the sequence of points A1 (1, 4), A2 (1, 3), A3 (2, 2), A4 (2, 1), A5 (4, 0), A6 (7, 0) is decreasing.

Write program points, which calculates the number of decreasing sequences of points for which x1 + y1 = a1, x2 + y2 = a2, ..., xn + yn = an.

입력

The positive integer n is given on the first line of the standard input. There are n nonnegative integers on the second line: a1, a2, ..., an.

출력

On a line of the standard output the program has to write by modulo 123456789 the number of the above described sequences.

제한

  • n ≤ 10000;
  • 0 ≤ ai ≤ 10000 for i = 1, 2, ..., n;
  • ai ≠ ai+1 for i = 1, 2, ..., n - 1;

예제 입력 1

3
4 5 3

예제 출력 1

10

힌트

출처

Olympiad > Balkan Olympiad in Informatics > Junior Balkan Olympiad in Informatics > JBOI 2013 3번

Olympiad > International Autumn Tournament in Informatics > 2013 > Group B (Juniors) 3번

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

출처

대학교 대회

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

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