1.区间是一段的,不是断开的哟
2.代码是看着标程写的
3.枚举左端点,二分右端点流程:
#include
#include
#include
#define LL long long
#define Max(a,b) ((a)>(b)?(a):(b))
#define Min(a,b) ((a)<(b)?(a):(b))
using namespace std;
cons...
分类:
编程语言 时间:
2015-07-22 14:43:59
收藏:
0 评论:
0 赞:
0 阅读:
1713
最近用富文本编辑器,编辑微信素材的时候,发现微信群发的消息内容中有许多Unicode编码字符。
后来发现是Gson使用不当的问题。Gson gson = new Gson();
String articleListStr = gson.toJson(articleList);
//将素材上传到微信服务器,系统群发的消息,其实是微信服务器上的素材。
String resposeString =...
分类:
其他 时间:
2015-07-22 14:43:50
收藏:
0 评论:
0 赞:
0 阅读:
468
上节我们学习了,如何用StartService启动服务,这节学习如何用BindService启动一个服务
首先看MyActivity的代码部分:
public class MyActivity extends Activity {
private Button btn_start;
private Button btn_end;
private MyServiceConnect...
分类:
移动平台 时间:
2015-07-22 14:43:39
收藏:
0 评论:
0 赞:
0 阅读:
343
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5289
题意:求满足最大值减最小值小于k的区间的数目。
代码:#include
#include
#include
#include
#include
#include
#include...
分类:
编程语言 时间:
2015-07-22 14:43:19
收藏:
0 评论:
0 赞:
0 阅读:
320
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.
For example,
If n = 4 and k = 2, a solution is:
[
[2,4],
[3,4],
[2,3],
[1,2],
[1,3],
[1,4],
]...
分类:
其他 时间:
2015-07-22 14:42:09
收藏:
0 评论:
0 赞:
0 阅读:
101
php.ini文件找不到,加载WINDOS下的,但找不到,后来强制-c查找是OK的,思考,为什么加载window下的ini文件。1.可能是有一个默认路径,2.可能没有路径,默认加载。
问题解决:http://php.net/manual/zh/configuration.file.php,,中有详细介绍php.ini的引用问题,寻找注册表,使用运行-》regedit,打开注册表h...
分类:
Web开发 时间:
2015-07-22 14:42:02
收藏:
0 评论:
0 赞:
0 阅读:
327
精美轮播图(完整代码), 让你爱不释手, 值得留恋....
分类:
其他 时间:
2015-07-22 14:42:01
收藏:
0 评论:
0 赞:
0 阅读:
212
Given a set of distinct integers, nums, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.
For ...
分类:
其他 时间:
2015-07-22 14:41:29
收藏:
0 评论:
0 赞:
0 阅读:
113
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.
...
分类:
其他 时间:
2015-07-22 14:41:09
收藏:
0 评论:
0 赞:
0 阅读:
119
1. 前言
为了安全和操作的可追溯性考虑,越来越多的公司加入了审计功能。mysql5.5推出了相关的审计功能,到5.6.20功能进一步完善,算是勉强可用了,虽然细粒度方面做的不是太好,但是后续版本还是可以期待一下的。这里主要介绍下相关的功能和特性。
2. 开启审计
2.1 配置文件加载
mysql5.6中的审计是通过audit_log插件来实现的,我们可以在配置文件...
分类:
数据库技术 时间:
2015-07-22 14:40:59
收藏:
0 评论:
0 赞:
0 阅读:
250
Follow up for "Remove Duplicates":
What if duplicates are allowed at most twice?
For example,
Given sorted array nums = [1,1,1,2,2,3],
Your function should return length = 5, with the first fi...
分类:
编程语言 时间:
2015-07-22 14:40:49
收藏:
0 评论:
0 赞:
0 阅读:
533
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given target is in the...
分类:
编程语言 时间:
2015-07-22 14:40:40
收藏:
0 评论:
0 赞:
0 阅读:
181
在学校的时候,也断断续续的用过 git和 vim,断断续续的原因是学校的网络对 github 支持不是很好,有时候会打不开,所以,用来对代码进行版本管理就不太合适了。所以,对 git 和 vim 的命令就不是多熟悉了。现在工作嘛,长期使用这两个工具,就一定要很熟悉才行,为了让自己不忘记一些常用命令,记录下吧。git 常用命令本地创建仓库
创建仓库
cd < target directory...
分类:
系统服务 时间:
2015-07-22 14:40:39
收藏:
0 评论:
0 赞:
0 阅读:
151
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
For example,
Given 1->2->3->3->4->4->5, return 1->2->5.
Given 1->1-...
分类:
编程语言 时间:
2015-07-22 14:39:31
收藏:
0 评论:
0 赞:
0 阅读:
211
该现象出现在2015版本上,之前从没注意过这个问题不知道以前的版本是否存在。
我的安装包的基础语言是中文,第一张图有添加产品的按钮,切换到英文环境下后就没有了,一开始以为是系统做了隐藏处理,但用工具查看home列表却发现没那3个按钮,那我们只能手工加了。
在home列表添加自定义按钮,然后分别添加Action和EnableRule,这个地方之所以用EnableRule是...
分类:
编程语言 时间:
2015-07-22 14:39:30
收藏:
0 评论:
0 赞:
0 阅读:
289
1. 在res目录下的drawable目录下新建shape.xml文件
<padding
android:bo...
分类:
移动平台 时间:
2015-07-22 14:38:39
收藏:
0 评论:
0 赞:
0 阅读:
238
adb
server端口
打开CMD
先执行adb nodaemon server ,查看adb
server的端口是多少
C:\Users\xxxx>adb nodaemon server
cannot bind 'tcp:5037'
再执行下netstat -ano | findstr "5037"...
分类:
数据库技术 时间:
2015-07-22 14:38:33
收藏:
0 评论:
0 赞:
0 阅读:
221
题意:
给你n块碎片,这些碎片不能旋转、翻折。
问你能不能用其中的某些块拼出4*4的正方形。
思路:
精确覆盖裸题了
建图就是看看每个碎片在4*4中能放哪些位置,这个就作为行。
列就是4*4=16个位置再加上n个碎片也就是16+n
然后注意下成立的判定就好了
代码:
#include"stdio.h"
#include"algorithm"
#include"string.h"
...
分类:
其他 时间:
2015-07-22 14:38:19
收藏:
0 评论:
0 赞:
0 阅读:
167
Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,
Given 1->1->2, return 1->2.
Given 1->1->2->3->3, return 1->2->3.
思路:此题与上一题异曲同工,具体解法如下:
...
分类:
编程语言 时间:
2015-07-22 14:38:09
收藏:
0 评论:
0 赞:
0 阅读:
238
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.
Above is a histogram where width o...
分类:
其他 时间:
2015-07-22 14:38:00
收藏:
0 评论:
0 赞:
0 阅读:
405