给出N个点,M次操作,N个点开始在一条线上链式相连
D操作 把某点删除掉
Q操作 询问某点一共可以连接多少个点
R操作 把上一次删除的点还原
线段树处理区间合并
分别记录每个区间的左端连续最长和右端连续最长
#include "stdio.h"
#include "string.h"
struct node
{
int l,r,lx,rx,x;
}data[2...
分类:
其他好文 时间:
2015-03-04 19:11:31
阅读次数:
137
要实现ListView列表的循环滚动效果,其实可以用RecyclerView实现。
Runnable run = new Runnable() {
@Override
public void run() {
// String str = "abc";
// datas.add(str);
// mRecyclerAdapter.notifyItemInserted(1...
分类:
其他好文 时间:
2015-03-04 19:10:21
阅读次数:
191
代码: 1 #include 2 3 using namespace std; 4 5 int lengthOfLongestSubString(string s) 6 { 7 if (s.length() == 0) 8 return 0; 9 int max ...
分类:
其他好文 时间:
2015-03-04 18:52:52
阅读次数:
104
DP类题目找到子问题(状态),然后找到转移方程,就OK#dp#likes matrixchain#according to two point's distance to recurrenceclass Solution: # @return a string def longest...
分类:
其他好文 时间:
2015-03-04 18:51:45
阅读次数:
122
java内部类使用局部变量,该变量必须声明final的原因:Java下的闭包(Closure):public static Runnable outter_func(){ final String param=System.getenv(”PATH”); Runnable r=new Runnabl...
分类:
其他好文 时间:
2015-03-04 18:46:12
阅读次数:
268
DescriptionLet S = s1 s2...s2n be a well-formed string of parentheses. S can be encoded in two different ways:q By an integer sequence P = p1 p2...pn ...
分类:
其他好文 时间:
2015-03-04 18:18:17
阅读次数:
117
一个提示?SyntaxError:?EOL?while?scanning?string?literal :反斜杆错误 \\ 不是 \ 我的mysite工程的整个目录: C:\web\mysite>tree?/F
卷?C?的文件夹?PATH?列表
卷序列号为?00000200?0007:9B9B
C...
分类:
编程语言 时间:
2015-03-04 17:12:36
阅读次数:
172
Problem Description
For the hope of a forever love, Steven is planning to send a ring to Jane with a romantic string engraved on. The string’s length should not exceed N. The careful Steven knows Jane...
分类:
其他好文 时间:
2015-03-04 16:59:08
阅读次数:
194
oracle 截取字符(substr),检索字符位置(instr) case when then else end语句使用 收藏常用函数:substr和instr1.SUBSTR(string,start_position,[length]) 求子字符串,返回字符串解释:string 元字符串 st...
分类:
数据库 时间:
2015-03-04 16:38:21
阅读次数:
169
1、dynamic 动态类型引入2、可选参数及指定参数赋值,参数默认值必须是常量static void Main(string[] args) { Test(1); Test(par1: 1); Test(1, par2...
分类:
Web程序 时间:
2015-03-04 16:34:48
阅读次数:
160