08 2016 档案

摘要:消息框 画图 导入图片 绘文字 监听事件 键盘事件 鼠标事件 增加新的对话窗口 阅读全文
posted @ 2016-08-29 18:24 wust_ouyangli 阅读(774) 评论(0) 推荐(0)
摘要:最基础的窗口 边界布局管理器 流式布局管理器 网格式布局管理器 面板 标签、文本框、密码框 复选框和单选按钮 下拉列表框和滚动条 拆分窗口和插入图片 设置图片 一些相关设置的操作 选项卡 菜单和工具条 表格 阅读全文
posted @ 2016-08-29 09:35 wust_ouyangli 阅读(262) 评论(0) 推荐(0)
摘要:异常处理 输入流 输出 类型转换 开数组 阅读全文
posted @ 2016-08-26 20:08 wust_ouyangli 阅读(147) 评论(0) 推荐(0)
摘要:题意: 给一个矩阵,给出行列和每个数,再给出一个N,求出所有N*N的子矩阵中最大值最小值之差的最小值解析: 暴力枚举肯定不行,这题可以用二维单调队列做,把同一行的连续N个点缩成一个点保存最大最小值预处理,用单调队列即可实现,再对整个矩阵进行枚举,再用一次单调队列。 代码 #include<cstdi 阅读全文
posted @ 2016-08-26 10:49 wust_ouyangli 阅读(197) 评论(0) 推荐(0)
摘要:Problem Description Now you are back,and have a task to do:Given you a string s consist of lower-case English letters only,denote f(s) as the number o 阅读全文
posted @ 2016-08-26 08:40 wust_ouyangli 阅读(145) 评论(0) 推荐(0)
摘要:Problem Description Given a string S. K-string is the sub-string of S and it appear in the S at least K times.It means there are at least K different 阅读全文
posted @ 2016-08-25 09:12 wust_ouyangli 阅读(969) 评论(0) 推荐(0)
摘要:Description A string is finite sequence of characters over a non-empty finite set Σ. In this problem, Σ is the set of lowercase letters. Substring, al 阅读全文
posted @ 2016-08-24 15:09 wust_ouyangli 阅读(156) 评论(0) 推荐(0)
摘要:代码 //确认maxn大小,一般是原字符串长度最大值的2倍,然后是init(),最后是一个一个的字符插入, //转化成对应的数字,调用Insert函数,可支持在线。 struct SAM { int ch[maxn][26]; int pre[maxn],step[maxn]; int last,i 阅读全文
posted @ 2016-08-24 14:59 wust_ouyangli 阅读(161) 评论(0) 推荐(0)
摘要:代码 //maxn,n取二分图两方中点数的最大值,首先init,然后在输入中加边AddEdge, //最后调用solve struct edge { int v,next; }E[2*maxn]; struct TwoMatch { int head[maxn],eid; bool vis[maxn 阅读全文
posted @ 2016-08-24 08:47 wust_ouyangli 阅读(146) 评论(0) 推荐(0)
摘要:单调栈 int rear=0; for(int st=1;st<=N;st++) { while(rear>0&&H[que[rear]]>=H[st]) --rear; if(rear==0) le[st]=0; else le[st]=que[rear]; que[++rear]=st; } 单 阅读全文
posted @ 2016-08-23 10:03 wust_ouyangli 阅读(303) 评论(0) 推荐(0)
摘要:搜索分为dfs(深度优先搜索)和bfs(广度优先搜索)。简单的爆搜: 适用于数据比较小或是访问数很少的情况,一般是初学者最开始接触的。剪枝搜索: 一般的爆搜不可行(TLE),在爆搜的基础上进行适当剪枝,有些题目需要强剪枝。这种题目难就难在如何剪枝,而不在搜的过程。一般会设置一个限制作为预估的条件,事 阅读全文
posted @ 2016-08-22 20:32 wust_ouyangli 阅读(206) 评论(0) 推荐(0)
摘要:将最大独立集转化为极大团来做 代码 //首先要init,初始化G全部置为true,除了G[i][i],然后对于连了边的(u,v),G[u][v]=G[v][u]=false; //接下来调用solve,group保存的是一组独立集的点,而且是字典序最小的。 struct MaxClique { bo 阅读全文
posted @ 2016-08-22 18:24 wust_ouyangli 阅读(373) 评论(0) 推荐(0)
摘要:代码 //首先init,传进去的参数分别是两边的点的个数,然后调用solve,如果是求 //最小值,改为负数,相当于的求负数的最大值。 struct KM { int W[maxn][maxn],n,m; int Lx[maxn],Ly[maxn]; int To[maxn]; bool S[max 阅读全文
posted @ 2016-08-22 11:12 wust_ouyangli 阅读(150) 评论(0) 推荐(0)
摘要:Problem Description A group of thieves is approaching a museum in the country of zjsxzy,now they are in city A,and the museum is in city B,where keeps 阅读全文
posted @ 2016-08-22 09:43 wust_ouyangli 阅读(226) 评论(0) 推荐(0)
摘要:题意:找树上有多少对距离小于K的对数解析:树分治模板题,见注释 代码 #include<cstdio> #include<cstring> #include<string> #include<algorithm> #include<vector> using namespace std; typed 阅读全文
posted @ 2016-08-21 19:44 wust_ouyangli 阅读(143) 评论(0) 推荐(0)
摘要:解析:平面上的点分治,先递归得到左右子区间的最小值d,再处理改区间,肯定不会考虑哪些距离已经大于d的点对,对y坐标归并排序,然后从小到大开始枚举更新d,对于某个点,x轴方向只用考虑[x-d,x+d](x是分的中轴线),y轴方向只用考虑[y-d,y](y是这个点的y值),因为d值一直在变小,所以这个矩 阅读全文
posted @ 2016-08-21 19:31 wust_ouyangli 阅读(365) 评论(0) 推荐(0)
摘要:Problem Description ACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的 阅读全文
posted @ 2016-08-17 16:48 wust_ouyangli 阅读(180) 评论(0) 推荐(0)
摘要:Problem Description A school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new co 阅读全文
posted @ 2016-08-17 16:02 wust_ouyangli 阅读(181) 评论(0) 推荐(0)
摘要:dijkstral堆优化算法 struct node { int u,d; node(int u=0,int d=0):u(u),d(d){} bool operator < (const node& t) const{ return d>t.d; } }; struct edge { int u, 阅读全文
posted @ 2016-08-17 08:07 wust_ouyangli 阅读(210) 评论(0) 推荐(0)
摘要:题意: 简化就是有两种操作,一种是插入(x,y,z)这个坐标,第二种是查询(x1,y1,z1)到(x2,y2,z2)(x1<=x2,y1<=y2,z1<=z2)的长方体包含多少个点。 解析: 将查询分成8个点,离线做,离散化z值,两次CDQ,第一次归并排x值,第二次归并排y值,z值用bit树维护更新 阅读全文
posted @ 2016-08-15 13:46 wust_ouyangli 阅读(460) 评论(0) 推荐(0)
摘要:Problem Description RD is a smart boy and excel in pinball game. However, playing common 2D pinball game for a great number of times results in accumu 阅读全文
posted @ 2016-08-12 10:57 wust_ouyangli 阅读(307) 评论(0) 推荐(0)
摘要:代码 //input(输入是先输N,再输N-1条边带权),调用dfs和Div,然后建线段树,更新每个点的值 //Find用于找两个点之间的最大值或其他,Update用于单点更新,如果成段更新于Find写得类似 #define tu nod[u] #define tv nod[v] #define e 阅读全文
posted @ 2016-08-11 08:39 wust_ouyangli 阅读(137) 评论(0) 推荐(0)
摘要:解析:增加三个变量lc(最左边的颜色),rc(最右边的颜色),sum(连续相同颜色区间段数)。然后就是区间合并的搞法。我就不详细解释了,估计你已经想到 如何做了。 代码 #include<cstdio> #include<cstring> #include<string> #include<vect 阅读全文
posted @ 2016-08-10 13:53 wust_ouyangli 阅读(233) 评论(0) 推荐(0)
摘要:代码 #include<cstdio> #include<cstring> #include<string> #include<vector> #include<algorithm> using namespace std; const int INF=1e9+7; const int maxn=3 阅读全文
posted @ 2016-08-10 09:49 wust_ouyangli 阅读(211) 评论(0) 推荐(0)
摘要:代码 //maxn是点的最大个数,首先init,然后用G加边,接下来调用dfs(根,1),ST(节点个数), //GetLca(u,v)用于查询两点的lca typedef pair<int,int> par; struct LCA { int id,ver[maxn*2],deep[maxn*2] 阅读全文
posted @ 2016-08-09 20:35 wust_ouyangli 阅读(290) 评论(0) 推荐(0)
摘要:题意中文我就不说了 解析: 分块+可持久化Trie,先得到前缀异或值,插入到Trie中,然后分块,对每一块,处理出dp[i][j](i代表第几块,j代表第几个位置),dp[i][j]代表以第i块开始的到j这个位置 的连续字串最大异或值。查询时,如果l,r不在同一块内,可以先查询l所在的块的后一个块到 阅读全文
posted @ 2016-08-09 10:28 wust_ouyangli 阅读(165) 评论(0) 推荐(0)
摘要:中文题题意我就不说了 解析: 可持久化Trie的模板题,详见注释 代码 #include<cstdio> #include<cstring> #include<string> #include<algorithm> using namespace std; const int maxbit=19; 阅读全文
posted @ 2016-08-08 21:10 wust_ouyangli 阅读(186) 评论(0) 推荐(0)
摘要:题意: 给出一个9*9的矩阵,有一些格子已经填了数,有一些是.代表未填。求任意一组解使得每行包含1~9,每列包含1~9,每个小矩形(3*3)包含1~9。 解析: 精确覆盖DLX的经典题目,每一行代表要填数的情况,列共有81*4行,第一个81行代表第i行j列放了数,第二个81列代表第i行放的数k,第三 阅读全文
posted @ 2016-08-08 18:41 wust_ouyangli 阅读(566) 评论(0) 推荐(0)
摘要:代码 struct DLX { int n,id; int L[maxn],R[maxn],U[maxn],D[maxn]; int C[maxn],S[maxn],loc[maxn][2]; int H[ms]; void init(int nn=0) //传列长 { n=nn; for(int 阅读全文
posted @ 2016-08-08 16:04 wust_ouyangli 阅读(191) 评论(0) 推荐(0)
摘要:Description After solving Solution to the n Queens Puzzle by constructing, LoadingTime wants to solve a harder version of the N-Queen Problem. Some qu 阅读全文
posted @ 2016-08-08 16:01 wust_ouyangli 阅读(316) 评论(0) 推荐(0)
摘要:代码 const int ChSize=5; struct PerTrie { int next[maxn*20][ChSize]; int id,inf[maxn*20]; void init() { memset(next[0],0,sizeof(next[0])); inf[0]=0; id= 阅读全文
posted @ 2016-08-08 11:05 wust_ouyangli 阅读(105) 评论(0) 推荐(0)
摘要:代码 struct DLX { int n,id; int L[maxn],R[maxn],U[maxn],D[maxn]; int C[maxn],S[maxn],loc[maxn][2]; int H[ms]; void init(int nn=0) //传列长 { n=nn; for(int 阅读全文
posted @ 2016-08-07 20:47 wust_ouyangli 阅读(196) 评论(0) 推荐(0)
摘要:Problem Description sevenzero liked Warcraft very much, but he haven't practiced it for several years after being addicted to algorithms. Now, though 阅读全文
posted @ 2016-08-07 20:10 wust_ouyangli 阅读(294) 评论(0) 推荐(0)
摘要:代码 struct DLX { int n,id; int L[maxn],R[maxn],U[maxn],D[maxn]; int C[maxn],S[maxn],loc[maxn][2]; void init(int nn=0) //传列长 { n=nn; for(int i=0;i<=n;i+ 阅读全文
posted @ 2016-08-07 20:08 wust_ouyangli 阅读(325) 评论(0) 推荐(0)
摘要:Description Ponyo and Garfield are waiting outside the box-office for their favorite movie. Because queuing is so boring, that they want to play a gam 阅读全文
posted @ 2016-08-07 18:24 wust_ouyangli 阅读(412) 评论(0) 推荐(0)
摘要:代码 //先init,然后Build_tree(hd[0],左,右),接下来Update(hd[前一个],hd[当前],左,右,数,数量) //可支持在线。最后可查询 #define e tree[rt] #define p tree[pre] int hd[maxn]; struct Tree{ 阅读全文
posted @ 2016-08-07 10:37 wust_ouyangli 阅读(138) 评论(0) 推荐(0)
摘要:Problem Description Alice get a string S. She thinks palindrome string is interesting. Now she wanna know how many three tuple (i,j,k) satisfy 1≤i≤j<k 阅读全文
posted @ 2016-08-07 10:34 wust_ouyangli 阅读(460) 评论(0) 推荐(0)
摘要:Problem Description In this problem, you are given a string s and q queries.For each query, you should answer that when all distinct substrings of str 阅读全文
posted @ 2016-08-07 10:18 wust_ouyangli 阅读(287) 评论(0) 推荐(0)
摘要:代码 int rmq[maxn][20],Lg[maxn]; void GetLg() { Lg[0]=-1; for(int i=1;i<maxn;i++) Lg[i]=Lg[i-1]+(i&(i-1)?0:1); } int f(int x){ return 1<<x; } void ST(in 阅读全文
posted @ 2016-08-05 15:55 wust_ouyangli 阅读(113) 评论(0) 推荐(0)
摘要:Problem Description YaoYao is fond of playing his chains. He has a chain containing n diamonds on it. Diamonds are numbered from 1 to n. At first, the 阅读全文
posted @ 2016-08-03 20:29 wust_ouyangli 阅读(298) 评论(0) 推荐(0)
摘要:Description Wind loves pretty dogs very much, and she has n pet dogs. So Jiajia has to feed the dogs every day for Wind. Jiajia loves Wind, but not th 阅读全文
posted @ 2016-08-03 18:14 wust_ouyangli 阅读(265) 评论(0) 推荐(0)
摘要:Description You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to 阅读全文
posted @ 2016-08-03 15:18 wust_ouyangli 阅读(153) 评论(0) 推荐(0)
摘要:解析: 多校标答 第一类:Pij 表示第i个点和第j个点组合的点,那么Pij的权值等于w[i][j]+w[j][i](表示得分)第二类:原串中的n个点每个点拆出一个点,第i个点权值为 –a[s[i]] (表示要花费)第三类:对于10种字符拆出10个点,每个点的权值为 -(b[x]-a[x]) 最大权 阅读全文
posted @ 2016-08-02 20:37 wust_ouyangli 阅读(170) 评论(0) 推荐(0)
摘要:Description 辉辉热衷于洞穴勘测。某天,他按照地图来到了一片被标记为JSZX的洞穴群地区。经过初步勘测,辉辉发现这片区域由n个洞穴(分别编号为1到n)以及若干通道组成,并且每条通道连接了恰好两个洞穴。假如两个洞穴可以通过一条或者多条通道按一定顺序连接起来,那么这两个洞穴就是连通的,按顺序连 阅读全文
posted @ 2016-08-01 21:00 wust_ouyangli 阅读(233) 评论(0) 推荐(0)