剑指offer上的第二道题目,在九度OJ上测试通过,但还是有些问题,因为是用C语言实现的,因此,要提前开辟一个比较大的空间来存储输入的字符串。而如果在线测试系统的测试用例中字符串的长度大于该最大值的话,会报RE,但是九度OJ的测试用例没有大于我所设定的字符串的最大值。当然,这道题目用C++中的string类或java中的String类实现会更好,不需要担心输入字符串的长度。...
分类:
其他好文 时间:
2014-05-07 04:52:58
阅读次数:
315
时间限制:10000ms
单点时限:1000ms
内存限制:256MB
Description
Find a pair in an integer array that swapping them would maximally decrease the inversion count of the array. If such a pair exists, retur...
分类:
其他好文 时间:
2014-04-27 17:48:35
阅读次数:
508