Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:怎么能快些?我写的求逆序数的函数是 n^2 的,总复杂度是 mn^2, 请教简单方法In Reply To:怎么能快些?我写的求逆序数的函数是 n^2 的,总复杂度是 mn^2, 请教简单方法 Posted by:sunmoonstar_love at 2005-08-07 16:03:10 O(n): 从后往前数,不同字母出现的次数分别记录在不同变量里. 遇到一个字母,逆序数的增量是比这个字母小的所有字母的次数和. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator