首页 > 其他
codeforces 487B B. Strip(rmq+线段树+二分)
题目链接:codeforces 487B题目大意:给出一个序列,要把序列划分成段,每一段最少有L个元素,段中的最大元素和最小元素之差不大于s,问划分的段的最少的数量是多少。题目分析: 首先用rmq维护区间最大值和区间最小值。 然后按顺序扫描数组,线段树维护的数组,每个记录当前点作为最后一个点的前i个点划分的最小的段数,那么每次更新就是二分找到可以转移到我的最远距离,然后再选取与我距离大于l的那部分,...
分类:其他   时间:2015-10-06 06:59:35    收藏:0  评论:0  赞:0  阅读:119
OpenCV 学习(像素操作 2)
在上一个学习笔记中,简单介绍了访问图像像素的几种方法,并对这几种方法的效率进行了些简单的比较。但是更多的情况是我们要同时访问多个像素,经过较为复杂的运算才能得到我们希望的结果。今天就来讲讲这种情况如何处理。同时访问多行像素数据下面我们以laplace 锐化为例,Laplacian 算子写为矩阵形式如下:???0?10?15?10?10??? \begin{pmatrix} 0 & -1 & 0 \\...
分类:其他   时间:2015-10-06 06:59:26    收藏:0  评论:0  赞:0  阅读:208
用 Maven 运行 MyBatis Generator(Running MyBatis Generator With Maven)
用 Maven 运行 MyBatis Generator(Running MyBatis Generator With Maven)...
分类:其他   时间:2015-10-06 06:59:16    收藏:0  评论:0  赞:0  阅读:195
Bubble Sort
referrence: GeeksforGeeksBubble sortis the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong ord...
分类:其他   时间:2015-10-06 06:58:25    收藏:0  评论:0  赞:0  阅读:270
Binary Search
Time complexity O(log(n)). When the question requires O(log(n)) time complexity, we always need to think whether it can be solved by binary search.For...
分类:其他   时间:2015-10-06 06:58:15    收藏:0  评论:0  赞:0  阅读:249
Seletion Sort
referrence: GeeksforGeeksThe selection sort algorithm sorts an array by repeatedly finding the minimum element (considering ascending order)from unsor...
分类:其他   时间:2015-10-06 06:57:55    收藏:0  评论:0  赞:0  阅读:215
UVA 10529 Dumb Bones
UVA 10529 Dumb Bones
分类:其他   时间:2015-10-06 06:57:47    收藏:0  评论:0  赞:0  阅读:199
四则运算测试
简介:一个能对0--10之间的整数进行四则运算的“软件” 程序能接收用户输入的整数答案,并判断对错 程序 结束时,统计出答对、答错的题目数量。需求分析:这个程序适用于小学低年级的小学生,可以进行一些简单的四则运算练习!刚开始看到这个题目时思路是有的,可是做起来的时候感觉有点困难,因为一些...
分类:其他   时间:2015-10-06 06:57:15    收藏:0  评论:0  赞:0  阅读:259
UVA 10417 Gift Exchanging
UVA 10417 Gift Exchanging
分类:其他   时间:2015-10-06 06:56:55    收藏:0  评论:0  赞:0  阅读:191
UVA 11605 Lights inside a 3d Grid
UVA 11605 Lights inside a 3d Grid
分类:其他   时间:2015-10-06 06:56:35    收藏:0  评论:0  赞:0  阅读:141
Leetcode Pascal's Triangle
GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]...
分类:其他   时间:2015-10-06 06:56:25    收藏:0  评论:0  赞:0  阅读:251
值得深思的连续赋值--赋值运算符运算顺序
最近在看到以前前辈留下的文章,对于连续赋值(var a={n:1}; a.x=a={n:2}))这个知识点,一开始也搞不清楚,但是最终还是说服了自己,谈谈自己的心得。以下代码能回答正确的可以忽略本文。1 var a={n:1};2 var b=a;3 a.x = a = {n: 2};4 conso...
分类:其他   时间:2015-10-06 06:56:15    收藏:0  评论:0  赞:1  阅读:244
BZOJ2874 : 训练士兵
设$a[i][j]$表示$(i,j)$右下角要增加多少$aj[i][j]=a[i][j]\times j$$ai[i][j]=a[i][j]\timesi$$aij[i][j]=a[i][j]\timesi\timesj$则查询$(x,y)$左上角内的权值和时,答案$=(x+1)(y+1)ask_{...
分类:其他   时间:2015-10-06 06:55:55    收藏:0  评论:0  赞:0  阅读:180
BEM,SASS,bootstrap
https://medium.com/@andersonorui_/bem-sass-and-bootstrap-9f89dc07d20fhttp://www.smashingmagazine.com/2014/07/bem-methodology-for-small-projects/http:/...
分类:其他   时间:2015-10-06 06:55:46    收藏:0  评论:0  赞:0  阅读:176
UVA 10288 Coupons
UVA 10288 Coupons
分类:其他   时间:2015-10-06 06:55:35    收藏:0  评论:0  赞:0  阅读:150
Leetcode Pascal's Triangle II
Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onlyO(...
分类:其他   时间:2015-10-06 06:55:25    收藏:0  评论:0  赞:0  阅读:213
Leetcode Meeting Rooms
Given an array of meeting time intervals consisting of start and end times[[s1,e1],[s2,e2],...](si= Ei, if true, continue compare, if false, return fa...
分类:其他   时间:2015-10-06 06:55:15    收藏:0  评论:0  赞:0  阅读:220
个人博客作业3
第一部分一.Bing BUG1.关于点击朗读的功能。当指向该朗读按键时,会出现点击朗读的字样,但还未点击就会自动朗读,而真正点击时往往会顿一下再朗读。而当鼠标不小心扫过该朗读按键时,也会自动朗读。这会违背用户的意愿,给用户造成一定困扰。2.划词功能的不完善划词功能设定为指向一个词时便会自动生成该词的...
分类:其他   时间:2015-10-06 06:55:05    收藏:0  评论:0  赞:0  阅读:221
Leetcode Majority Element II
Given an integer array of sizen, find all elements that appear more than? n/3 ?times. The algorithm should run in linear time and in O(1) space.Hint:H...
分类:其他   时间:2015-10-06 06:54:45    收藏:0  评论:0  赞:0  阅读:317
LeetCode #10 Regular Expression Matching (H)
[Problem]Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding el...
分类:其他   时间:2015-10-06 06:54:15    收藏:0  评论:0  赞:0  阅读:215
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!