
数据结构
文章平均质量分 70
sysu_zjl
这个作者很懒,什么都没留下…
展开
-
[leetcode]#78 Subsets
Given a set of distinct integers, nums, return all possible subsets.Note: Elements in a subset must be in non-descending order. The solution set must not contain duplicate subsets. For example, If原创 2015-10-21 11:12:15 · 595 阅读 · 0 评论 -
[leetcode]#160 Intersection of Two Linked Lists
Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘原创 2015-10-21 10:30:46 · 262 阅读 · 0 评论 -
[线段树点修改]动态最大连续和(Ray,Pass me the Dishes, LA 3938)
[线段树点修改]动态最大连续和(Ray,Pass me the Dishes, LA 3938)“Ray, Pass me the dishes!” After doing Ray a great favor to collect sticks for Ray, Poor Neal becomes very hungry. In return for Neal’s help, Ray makes原创 2015-10-27 23:29:53 · 626 阅读 · 0 评论 -
线段树(2)区间修改
线段树(2)区间修改快速序列操作I,给出一个n个元素的数组A1,A2,…,An,你的任务是设计一个数据结构支持一下两种操作 set(L, R, v): 把AL,AL+1,…,Ar的值全部修改为v(v>=0) Query(L, R):计算子序列AL,AL+1,…Ar的元素和、最小值和最大值。#include <cstdio>#include <algorithm>using namespace原创 2015-10-27 23:36:26 · 377 阅读 · 0 评论 -
[leetcode] #155 Min Stack
[leetcode] #155 Min StackDesign a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) – Push element x onto stack. pop() – Removes the element on top of the原创 2015-10-14 10:21:21 · 513 阅读 · 0 评论 -
Trie字符串(Remember the Word, LA 3942)
Trie字符串(Remember the Word, LA 3942)给出一个由S个不同单词组成的字典和一个长字符串。把这个字符串分解成若干个单词的连接(单词可重复使用),有多少种方法?比如,有4个单词a、b、cd、ab,则abcd有两种分解方法:a+b+cd和ab+cd。 输入格式: 输入包含多组数据。每组数据第一行为小写字母组成的待分解字符串,长度不超过300000.第二行为单词原创 2015-11-01 00:03:00 · 398 阅读 · 0 评论 -
[codeforces]#350E. Correct Bracket Sequence Editor
E. Correct Bracket Sequence Editor time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard outputRecently Polycarp sta原创 2016-05-06 13:25:09 · 1563 阅读 · 0 评论