文件名称:Tight-words
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:8.52kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
描述:
提出了一个字母,一个…{ 0 },< = k - k < = 9。我们说一个字的长度n在这个字母是紧如果任何两个邻居位数不同的词不超过1。输入是一个序列的线,每行包含两个整数n、k和1 < = n < = 100。在每一行输入、输出的百分比的长度n多紧单词字母{ 0、1、……,凯西} 5分形位数。
样本输入:
4一
2 5
3 - 5
8 7
样本输出:
100.00000
40.74074
17.38281
0.10130-Descr iption:
Given is an alphabet {0, 1, ... , k}, 0 <= k <= 9 . We say that a word of length n over this alphabet is tight if any two neighbour digits in the word do not differ by more than 1. Input is a sequence of lines, each line contains two integer numbers k and n, 1 <= n <= 100. For each line of input, output the percentage of tight words of length n over the alphabet {0, 1, ... , k} with 5 fractional digits.
Sample Input:
4 1
2 5
3 5
8 7
Sample Output:
100.00000
40.74074
17.38281
0.10130
提出了一个字母,一个…{ 0 },< = k - k < = 9。我们说一个字的长度n在这个字母是紧如果任何两个邻居位数不同的词不超过1。输入是一个序列的线,每行包含两个整数n、k和1 < = n < = 100。在每一行输入、输出的百分比的长度n多紧单词字母{ 0、1、……,凯西} 5分形位数。
样本输入:
4一
2 5
3 - 5
8 7
样本输出:
100.00000
40.74074
17.38281
0.10130-Descr iption:
Given is an alphabet {0, 1, ... , k}, 0 <= k <= 9 . We say that a word of length n over this alphabet is tight if any two neighbour digits in the word do not differ by more than 1. Input is a sequence of lines, each line contains two integer numbers k and n, 1 <= n <= 100. For each line of input, output the percentage of tight words of length n over the alphabet {0, 1, ... , k} with 5 fractional digits.
Sample Input:
4 1
2 5
3 5
8 7
Sample Output:
100.00000
40.74074
17.38281
0.10130
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Tight words.docx
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.