算法
浪花消波块
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
逆置链表
题目描述输入一个链表,反转链表后,输出新链表的表头。答案/*struct ListNode {int val;struct ListNode *next;ListNode(int x) :val(x), next(NULL) {}};*/class Solution {public: ListNode* ReverseList(ListNode* pHead) { ListNode *pre = nullptr; ...原创 2020-09-13 01:10:31 · 317 阅读 · 0 评论 -
动态规划 连续子数组的最大和
剑指 Offer 42. 连续子数组的最大和难度简单72输入一个整型数组,数组里有正数也有负数。数组中的一个或连续多个整数组成一个子数组。求所有子数组的和的最大值。要求时间复杂度为O(n)。示例1:输入: nums = [-2,1,-3,4,-1,2,1,-5,4]输出: 6解释:连续子数组[4,-1,2,1] 的和最大,为6。提示:1 <=arr.length <= 10^5-100 <= arr[i] <= 100动态规...原创 2020-07-10 21:44:00 · 259 阅读 · 0 评论 -
Curling 2.0
题目:Curling 2.0Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 22426 Accepted: 9102DescriptionOn Planet MM-21, after their Olympic games this year, c原创 2017-09-23 22:57:29 · 508 阅读 · 0 评论 -
Cube Stacking
题目:Cube StackingTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 26451 Accepted: 9254Case Time Limit: 1000MSDescriptionFarmer John and Be原创 2018-01-25 21:32:46 · 299 阅读 · 0 评论 -
专题一 BFS
部分和#include<stdio.h>#define N 20int a[N],b[N];int n,k;int dfs(int i, int sum);int cou=0;int main(){ int i; scanf("%d%d", &n,&k); for(i=0; i<n; i++) { scanf("%d", &a...原创 2018-07-14 22:50:10 · 177 阅读 · 0 评论
分享