QOJ.ac

QOJ

時間限制: 3 s 記憶體限制: 512 MB 總分: 100

#5468. トカマク

统计

問題背景

2021年5月28日、憶国のトカマク(Tokamak)装置「憶ST」が初めて実験に成功し、$1.2 \times 10^8 \, ^\circ\text{C}$ で102秒間運転しました。

3021年、人類星際連邦は新たな実験を開始しました。それは真空零点エネルギーの抽出です。

問題

真空零点エネルギー抽出実験は、概ね次のようなプロセスとして抽象化できます。

$n$ 個の区間 $[l_i, r_i]$ が以下のルールに従ってランダムに生成されます。

  • 各 $i$ について、まず $[0, 1]$ 上の独立な一様乱数 $x_i, y_i$ を取り、$l_i = \min(x_i, y_i), r_i = \max(x_i, y_i)$ とします。

ある $x \in [0, 1]$ が存在し、その $x$ を覆う区間が少なくとも $k$ 個ある場合、エネルギー閾値を突破したとみなし、実験は成功となります。

憶艾は、$n$ が $k \le n \le N$ の範囲にあるとき、それぞれの場合において実験が成功する確率を知りたいと考えています。

答えを $998244353$ で割った余りを出力してください。

入力

入力は以下の形式で標準入力から与えられる。

$N \ k$

出力

$N - k + 1$ 行出力せよ。第 $i$ 行目には、$n = k + i - 1$ 個の区間を生成したときの確率を出力せよ。

入出力例

入力 1

4 2

出力 1

665496236
133099248
874652196

入力 2

10 5

出力 2

649651087
469592582
90638682
971355617
213732434
682398780

入力 3

5000 4990

出力 3

433547646
604946601
315883076
866829944
796432253
375436914
90833037
455045447
570901064
289574480
958621891

注記

入出力例 1 の3つの値は、それぞれ $\frac{2}{3}$、$\frac{14}{15}$、$\frac{104}{105}$ です。

制約

  • $10\%$ のテストケースにおいて、$N \le 10$ を満たす。
  • $30\%$ のテストケースにおいて、$N \le 10^3$ を満たす。
  • 別の $20\%$ のテストケースにおいて、$k \le 10^2, N \le 10^5$ を満たす。
  • $70\%$ のテストケースにおいて、$k \le 5 \times 10^4$ を満たす。
  • $90\%$ のテストケースにおいて、$N \le 2 \times 10^5$ を満たす。
  • すべてのテストケースにおいて、$2 \le k \le N \le 5 \times 10^5$ を満たす。

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.