文件名称:ABstring1518
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:8.87kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
假设a移到最左端,那么步骤 : 第一个a移到最左端,然后第二个移到最左端,....从左到右,先后顺序,这样肯定移动次数最少
同理,假设b移到最左端,那么步骤也是一样的,从左到又一个一个往左移动
am 表示最左边已经有 a字符的个数
sa 表示a往最左边移动,已经耗费的移动次数
bm 和 sb 和上面的概念对应
注意,其实根本就没有真正的移动,只是假设性的移动,用i-am和i-bm分别计算a和b移到左端的操作次数
设s[0]表示第一个字符,就是a字符
不等于s[0]的就是第二个字符,就是b字符*/-Assume that a move to the left, then the steps: first a move to the left, then move to the extreme left ,.... second from left to right order, so surely the least number of moves Similarly, if b shift to the left, then the procedure is the same, from left to another one moves to the left am, said the left-most characters have a number of sa that a move to the left, the movement has been spent and the number of bm sb and the concept of the above corresponding to the note, the fact is there is no real movement, but the hypothetical movement, with i-am and i-bm a and b were calculated move to the left of the number of operations set s [0] for the first character is a character not equal to s [0] is the second character is the b character* /
同理,假设b移到最左端,那么步骤也是一样的,从左到又一个一个往左移动
am 表示最左边已经有 a字符的个数
sa 表示a往最左边移动,已经耗费的移动次数
bm 和 sb 和上面的概念对应
注意,其实根本就没有真正的移动,只是假设性的移动,用i-am和i-bm分别计算a和b移到左端的操作次数
设s[0]表示第一个字符,就是a字符
不等于s[0]的就是第二个字符,就是b字符*/-Assume that a move to the left, then the steps: first a move to the left, then move to the extreme left ,.... second from left to right order, so surely the least number of moves Similarly, if b shift to the left, then the procedure is the same, from left to another one moves to the left am, said the left-most characters have a number of sa that a move to the left, the movement has been spent and the number of bm sb and the concept of the above corresponding to the note, the fact is there is no real movement, but the hypothetical movement, with i-am and i-bm a and b were calculated move to the left of the number of operations set s [0] for the first character is a character not equal to s [0] is the second character is the b character* /
(系统自动生成,下载前可以参看下载内容)
下载文件列表
ABstring1518.docx
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.