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

18746번 - Exp 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 512 MB111332427.273%

문제

Find the expected amount of experience a hero will get for beating n monsters one by one, given that beating each monster gives the hero i units of experience (0 ≤ i ≤ k) with probability pi independently, but if the hero gets more than x units of experience in total, their experience is capped to exactly x units, and display it modulo 998 244 353.

입력

The first line contains three integers n, k, and x (1 ≤ n ≤ 107; 1 ≤ k ≤ 100; 1 ≤ x ≤ min(107, 5·107/k)).

The second line contains k + 1 real numbers p0, p1, . . . , pk (0 < pi < 1), given with exactly 4 decimal digits. The sum of pi is equal to 1.

출력

Display the expected amount of experience the hero will get.

It can be shown that the sought number can be represented as an irreducible fraction p/q such that q ≢ 0 (mod 998 244 353). Then, there exists a unique integer r such that r · q ≡ p (mod 998 244 353) and 0 ≤ r < 998 244 353, so display this r.

제한

예제 입력 1

2 1 2
0.5000 0.5000

예제 출력 1

1

예제 입력 2

2 1 1
0.5000 0.5000

예제 출력 2

249561089

예제 입력 3

4 2 5
0.2000 0.5000 0.3000

예제 출력 3

909700083

예제 입력 4

10 4 23
0.4533 0.2906 0.1618 0.0071 0.0872

예제 출력 4

433575862

힌트

In the first test case, the hero will get 0 units of experience with probability 1/4, 1 unit of experience with probability 1/2, and 2 units of experience with probability 1/4. Hence, the expected amount is 1.

In the second test case, the hero will get 0 units of experience with probability 1/4, and 1 unit of experience with probability 3/4. The expected amount is 3/4.

출처

Camp > Petrozavodsk Programming Camp > Winter 2020 > Day 7: Gennady Korotkevich Contest 5 E번

Contest > Open Cup > 2019/2020 Season > Stage 11: Grand Prix of Gomel E번

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

출처

대학교 대회

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

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