09 2017 档案

摘要:N个整数组成的序列a[1],a[2],a[3],…,a[n],求该序列如a[i]+a[i+1]+…+a[j]的连续子段和的最大值。当所给的整数均为负数时和为0。 例如:-2,11,-4,13,-5,-2,和最大的子段为:11,-4,13。和为20。 N个整数组成的序列a[1],a[2],a[3],… 阅读全文
posted @ 2017-09-09 19:43 小小超plus 阅读(160) 评论(0) 推荐(0)
摘要:给出2个大整数A,B,计算A*B的结果。 给出2个大整数A,B,计算A*B的结果。 Input 第1行:大数A 第2行:大数B (A,B的长度 <= 1000,A,B >= 0) Output 输出A * B Input示例 123456 234567 Output示例 28958703552把两个 阅读全文
posted @ 2017-09-09 19:42 小小超plus 阅读(178) 评论(0) 推荐(0)
摘要:在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。 如2 4 3 1中,2 1,4 3,4 1,3 1是逆序,逆序数是4。给出一个整数序列,求该序列的逆序数。 在一个排列中,如果一对数的前后位置与大小顺序相反 阅读全文
posted @ 2017-09-09 19:38 小小超plus 阅读(165) 评论(0) 推荐(0)
摘要:给出两个字符串A B,求A与B的最长公共子序列(子序列不要求是连续的)。 比如两个串为: abcicba abdkscab ab是两个串的子序列,abc也是,abca也是,其中abca是这两个字符串最长的子序列。 给出两个字符串A B,求A与B的最长公共子序列(子序列不要求是连续的)。 比如两个串为 阅读全文
posted @ 2017-09-09 19:34 小小超plus 阅读(312) 评论(0) 推荐(0)
摘要:在国际象棋棋盘上放置八个皇后,要求每两个皇后之间不能直接吃掉对方。Input无输入。Output按给定顺序和格式输出所有八皇后问题的解(见Sample Output)。Sample Input Sample Output Hint此题可使用函数递归调用的方法求解。 经典的DFS入门题 核心代码就是一 阅读全文
posted @ 2017-09-09 09:18 小小超plus 阅读(296) 评论(0) 推荐(0)
摘要:A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacen 阅读全文
posted @ 2017-09-05 23:19 小小超plus 阅读(113) 评论(0) 推荐(0)
摘要:The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of 阅读全文
posted @ 2017-09-05 22:17 小小超plus 阅读(100) 评论(0) 推荐(0)