Description
Farmer John's cows have discovered that the clover growing along the ridge of the hill (which we can think of as a one-dimensional number line) in his field is particularly good.
Fa...
分类:
其他好文 时间:
2015-06-03 21:43:24
阅读次数:
119
Description
Japan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coast (M <...
分类:
其他好文 时间:
2015-06-03 21:38:18
阅读次数:
143
// hdu 1394 Minimum Inversion Number 线段树 点更新
//
// 典型线段树的单点更新
//
// 对于求逆序数,刚开始还真的是很年轻啊,裸的按照冒泡排序
// 求出最初始的逆序数,然后按照公式递推,结果就呵呵了
//
// 发现大牛都是用线段树和树状数组之类的做的,而自己又在学
// 线段树,所以就敲了线段树。
//
// 线段树的节点保存一段区间( L,R ...
分类:
其他好文 时间:
2015-06-03 21:36:28
阅读次数:
115
Description
In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the seque...
分类:
其他好文 时间:
2015-06-03 15:48:26
阅读次数:
108
Problem Description
How many nondecreasing subsequences can you find in the sequence S = {s1, s2, s3, …., sn} ? For example, we assume that S = {1, 2, 3}, and you can find seven nondecreasing subseque...
分类:
编程语言 时间:
2015-06-02 22:08:26
阅读次数:
141
1 #include 2 #include 3 #include 4 #include 5 #define ll long long 6 #define MAX 500005 7 using namespace std; 8 9 struct Node10 {11 int val,po...
分类:
编程语言 时间:
2015-06-02 17:43:33
阅读次数:
117
树状数组是和线段树类似的数据结构,基本上树状数组可以做的线段树都可以做;树状数组就是一个数组,在信息记录上有一些特点,以动态求前n项和为例:可以改变数组的某一个元素,求前n项和;数组tree[ i ]记录的是A[ i - lowbit ( i )+1]~A[ i ]的和,lowbit(i),表示i的...
分类:
编程语言 时间:
2015-06-02 13:08:07
阅读次数:
117
树状数组,逆序数,poj,poj 2299,归并求逆序数
分类:
其他好文 时间:
2015-06-02 09:16:57
阅读次数:
172
分析:注意队列中保存的是排序后数组中的下标。树状数组也是根据下标进行处理。
#include
#include
#include
using namespace std;
#define N 10005
int c[N<<2];
int n,a[N],b[N];
char str[N][10];
int lowbit(int x)
{
return x&(-x);
}
voi...
分类:
编程语言 时间:
2015-06-01 22:52:25
阅读次数:
191
一 简单样式TreeNodeDemo.javapackage com.sjf;import javax.swing.JFrame;
import javax.swing.JTree;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swi...
分类:
编程语言 时间:
2015-05-31 23:23:40
阅读次数:
173