QOJ.ac

QOJ

시간 제한: 1 s 메모리 제한: 1024 MB 총점: 100

#14378. 猜掷骰子点数

통계

有 $N$ 名玩家正在玩一个猜数字游戏。每个玩家预测一个长度为 $L$ 且由 $\{1, 2, 3, 4, 5, 6\}$ 组成的序列。接着,一颗骰子会被不断投掷,投掷出的序列会被记录下来。最先使其预测序列与骰子最后 $L$ 次投掷结果相匹配的玩家赢得游戏。

输入格式

第一行是测试用例的数量。

对于每个测试用例,第一行包含两个整数 $N$ ($1 \le N \le 10$) 和 $L$ ($1 \le L \le 10$)。

接下来的 $N$ 行,每行包含一个长度为 $L$ 的预测序列。保证预测序列仅由 $\{1, 2, 3, 4, 5, 6\}$ 组成,且所有预测序列两两不同。

输出格式

对于每个测试用例,输出一行,包含每个玩家获胜的概率,保留 6 位小数。

样例

输入样例 1

3
5 1
1
2
3
4
5
6 2
1 1
2 1
3 1
4 1
5 1
6 1
4 3
1 2 3
2 3 4
3 4 5
4 5 6

输出样例 1

0.200000 0.200000 0.200000 0.200000 0.200000
0.027778 0.194444 0.194444 0.194444 0.194444 0.194444
0.285337 0.237781 0.237781 0.239102

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.