题意 中文
动态区间和问题 只会更新点 最基础的树状数组 线段树的应用
树状数组代码
#include
using namespace std;
const int N = 50005;
int c[N], n, m;
void add(int p, int x)
{
while(p <= n)
c[p] += x, p += p & -p;
}
int...
分类:
编程语言 时间:
2015-04-14 14:46:01
阅读次数:
147
题意 动态查询第K大的数
用小数在前优先队列维护K个数 每要插入一个数时 若这个数小于队首元素那么就不用插入了 否则队首元素出队 这个数入队 每次询问只用输出队首元素就行了
#include
#include
using namespace std;
int main()
{
int n, a, k;
char op[5];
while(~scanf("%d%...
分类:
其他好文 时间:
2015-04-14 14:45:18
阅读次数:
175
一开始还在想去重的问题,结果发现后台数据貌似没有重复的情况= =
/*
ID: 18906421
LANG: C++
PROG: milk3
*/
#include
#include
#include
#include
using namespace std;
const int maxn = 25;
int vis[maxn][maxn][maxn] = {0};
vectorans;
int...
分类:
其他好文 时间:
2015-04-14 14:40:36
阅读次数:
151
CREATE PROCEDURE `test`.`new_procedure` ()BEGIN-- 需要定义接收游标数据的变量 DECLARE a CHAR(16); -- 遍历数据结束标志 DECLARE done INT DEFAULT FALSE; -- 游标 DECLARE cur CUR....
分类:
数据库 时间:
2015-04-14 14:35:28
阅读次数:
136
这里利用直接寻址法去重,遍历链表,如果对应数组位置值为0,则修正为1,如果对应数组为1,则删除该节点。(数组初始化为0)链表的一些操作都简单的实现了一下。#include #include #include struct Node{ int key; Node *next;};struc...
分类:
编程语言 时间:
2015-04-14 14:26:36
阅读次数:
174
#include //void show(char *p[]);void show(char s[][10]);int main(){ char s[3][10]={"123","abc","xyz"}; char *p[10]; //指针数组要循环复制 ...
分类:
编程语言 时间:
2015-04-14 14:24:36
阅读次数:
158
比如我有一个javabean:
//部门类
public?class?Territory{
???private?int?id;
???private?String?territoryName;
???public?void?setId(int?id){
???????this.id?=?id;
???}
??...
分类:
编程语言 时间:
2015-04-14 13:10:39
阅读次数:
162
public class SamplePagerView extends RelativeLayout{ public SamplePagerView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); // TODO Auto-generated constructor ...
分类:
其他好文 时间:
2015-04-14 13:09:03
阅读次数:
144
对于单通道字节型图像:
IplImage* img = cvCreateImage(cvSize(640,480),IPL_DEPTH_8U,1);
int height = img->height;
int width = img->width;
int step = img->widthStep;
uchar* data = (uchar *)img->...
分类:
其他好文 时间:
2015-04-14 13:03:04
阅读次数:
99
重定位决定引用(absolute reference relocation)
还是承接前面的程序,在swap.c中 “int *bufp0 = &buf[0];”bufp0被初始化为一个全局的数组地址,所以需要重定位,详细信息如图和, r.offset=0xc, r.symbol=buf, r.type=R_386_32 ,重定位条目告诉编译器,这是一个32位的绝对引用,必须重定位才能指...
分类:
其他好文 时间:
2015-04-14 13:02:28
阅读次数:
165