Problem 1934 --Problem B: Tight words

1934: Problem B: Tight words

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $3$ 正确数量 $3$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签

Problem B: Tight words

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.

4 1
2 5
3 5
8 7
100.00000
40.74074
17.38281
0.10130

推荐代码 查看1934 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] AOJ大管家 84449 2017-04-27 15:30:03
内存最少[$0 $KB] 淡意的温柔 589800 2020-06-01 15:11:11
第一AC AOJ大管家 84449 2017-04-27 15:30:03
第一挑战 AOJ大管家 84449 2017-04-27 15:30:03

赛题来源/所属竞赛 NA N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛