問題一覧 > 通常問題

No.2462 Canon for Seven

レベル : / AI推定難易度 : 650 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-5}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 120
作問者 : 👑 Nachia / テスター : chineristAC
お気に入りにしたユーザー ProblemId : 5392 / 自分の提出
問題文最終更新日: 2023-09-08 21:03:39
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 404 (順位表) の他の問題:

Problem Statement

You are given a performance procedure for $N$ performers, numbered from performer $1$ to performer $N$. The procedure consists of $Q$ instructions, and the $i$-th instruction is "Performer $I_i$ shall play from time $S_i$ to time $T_i$." Here, time $X$ means the moment $X$ seconds after the whole performance begins. A performer who is playing at some time is never given another instruction to play at that time.

Each performer has a prominence defined according to the performance so far, and at time $0$ the prominence of every performer is $0$. While nobody is playing, the prominence does not change. While $n$ people $(1 \leq n)$ are playing, the prominence of each playing performer increases by $ \frac {1}{n}$ per $1$ second.

Find the final prominence of each performer when the performance is played to the end according to this procedure.

Constraints

  • All values are integers.
  • $1 \leq N \leq 10^5$
  • $1 \leq Q \leq 10^5$
  • $1 \leq I_i \leq N$
  • $0 \leq S_i \lt T_i \leq 10^5$
  • When $i \neq j$ and $I_i = I_j$, the interval $[S_i,T_i]$ and the interval $[S_j,T_j]$ have no range in common.

Input

The input is given from standard input in the following format.

$N$ $Q$
$I_1$ $S_1$ $T_1$
$I_2$ $S_2$ $T_2$
$ \hspace{5px}\vdots $
$I_Q$ $S_Q$ $T_Q$

Output

The output consists of $N$ lines. On the $i$-th line, print the final prominence of performer $i$ as a decimal.

For each value, reference data has been prepared whose absolute or relative error from the true value is at most $10^{-8}$, and your output is accepted if the absolute or relative error of the value printed by the submitted program, measured against that data, is at most $10^{-5}$. Print a newline at the end.

Sample

Sample 1
Input
7 7
1 0 1
2 0 1
3 0 1
4 0 1
5 0 1
6 0 1
7 0 1
Output
0.14285714285714
0.14285714285714
0.14285714285714
0.14285714285714
0.14285714285714
0.14285714285714
0.14285714285714

$7$ people play simultaneously for $1$ second, so each prominence increases by $ \frac {1}{7}$.

Sample 2
Input
2 3
1 0 10000
1 20000 30000
1 40000 50000
Output
30000
0

Performer $2$, who received no instruction to play, has a prominence of $0$.

Sample 3
Input
7 7
1 0 7
2 1 8
3 2 9
4 3 10
5 4 11
6 5 12
7 6 13
Output
2.59285714285714
1.75952380952381
1.45952380952381
1.37619047619048
1.45952380952381
1.75952380952381
2.59285714285714

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。