题意
组数据,每次给你两个数,问你由个和个组成的字符串的第小的字典序的字符串是什么。
思路
我们通过观察可以知道规律,1+2+3+…+n,符合前项和的部分规律,第个串由两个的位置唯一确定,由后往前找第一个的位置,这个位置就是前项和大于的位置,第二个位置就是前项和与的差,详细见代码。
参考代码
组数据,每次给你两个数,问你由个和个组成的字符串的第小的字典序的字符串是什么。
我们通过观察可以知道规律,1+2+3+…+n,符合前项和的部分规律,第个串由两个的位置唯一确定,由后往前找第一个的位置,这个位置就是前项和大于的位置,第二个位置就是前项和与的差,详细见代码。
传送门题目大意题目中介绍了一个与斐波那契数列相识的k-bonacci数列。斐波那契数列是第一二项为1,从
传送门题目大意
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M