![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
KrisFeng00
这个作者很懒,什么都没留下…
展开
-
1049 数列的片段和 (20 分)
1049 数列的片段和 (20 分)给定一个正数数列,我们可以从中截取任意的连续的几个数,称为片段。例如,给定数列 { 0.1, 0.2, 0.3, 0.4 },我们有 (0.1) (0.1, 0.2) (0.1, 0.2, 0.3) (0.1, 0.2, 0.3, 0.4) (0.2) (0.2, 0.3) (0.2, 0.3, 0.4) (0.3) (0.3, 0.4) (0.4) 这 10 个片段。给定正整数数列,求出全部片段包含的所有的数之和。如本例中 10 个片段总和是 0.1 + 0.3 +原创 2021-09-09 16:22:51 · 71 阅读 · 0 评论 -
2021-04-26
一个数在不同进制下的表示做一个小的记录,在转换的时候怕忘记long long int getNum(string s, long long int radix){ long long int sum = 0; for(int i = 0; i < s.size(); i++){ int val = (s[i] >= '0' && s[i] <= '9') ? (s[i] - '0') : (s[i] -'a' + 10);原创 2021-04-26 13:22:40 · 47 阅读 · 0 评论 -
1009 Product of Polynomials (25 分)
1009 Product of Polynomials (25 分)This time, you are supposed to find A×B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial:K原创 2021-04-07 13:20:39 · 48 阅读 · 0 评论 -
1008 Elevator (20 分)
1008 Elevator (20 分)The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one fl原创 2021-04-07 09:10:47 · 44 阅读 · 0 评论 -
1007 Maximum Subsequence Sum (25 分)
1007 Maximum Subsequence Sum (25 分)原创 2021-04-06 20:25:41 · 54 阅读 · 0 评论 -
反转数字
反转数字简单的一个实现方式,我觉得特别实用,做一个小的记录,如有雷同,纯属巧合????##直接上代码// c codeint reverse(int number){ int reverseNum = 0, count = number; while(count / 10 > 0){ reverseNum = reverseNum * 10 + count % 10; count = count / 10; } return reverseNum;}...原创 2021-03-28 14:36:28 · 81 阅读 · 0 评论