随机打乱
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
问以下 C++(伪)代码的结果里,每个数字出现在各个位置上的概率:
for (int i=1;i<=n;i++) a[i]=i;
for (int i=1;i<=n;i++){
int j=Rand(1,n);
swap(a[i],a[j]);
}
其中 Rand(l,r)
表示从区间 中等概率随机一个整数。
Format
Input
读入一个正整数 。
Output
输出 行。 每行 个数字,第 行的数字表示 到 每个数字出现在位置 上的概率。 绝对精度或相对精度误差小于 即认为正确。
Samples
5
0.2000000000 0.2419200000 0.2099200000 0.1843200000 0.1638400000
0.2000000000 0.1804800000 0.2304000000 0.2048000000 0.1843200000
0.2000000000 0.1856000000 0.1740800000 0.2304000000 0.2099200000
0.2000000000 0.1920000000 0.1856000000 0.1804800000 0.2419200000
0.2000000000 0.2000000000 0.2000000000 0.2000000000 0.2000000000
Limitation
对于 的数据,保证 。
对于 的数据,保证 。
8.23普及提高大联欢【Div.1+2】
- Status
- Done
- Rule
- OI
- Problem
- 6
- Start at
- 2023-8-23 8:30
- End at
- 2023-8-23 13:00
- Duration
- 4.5 hour(s)
- Host
- Partic.
- 18