Rectangle and Circle
Problem Description
Given a rectangle and a circle in the coordinate system(two edges of the rectangle are parallel with the X-axis, and the other two are parallel with the Y...
分类:
其他好文 时间:
2014-07-02 07:29:06
阅读次数:
268
1.splint
2.strace
3.ltrace...
分类:
其他好文 时间:
2014-07-02 08:26:07
阅读次数:
300
定义
欧拉函数f(n)表示小于n并且与n互质的数的个数
f(n)=n(1?1p1)(1?1p2)…(1?1pk)
(pi为n的质因子)
代码
C++ 单个处理int eulerPhi(int n) {
int m = (int)sqrt(n+0,5);
in ans = n;
for (int i = 2; i m; i++) {...
分类:
其他好文 时间:
2014-07-02 07:53:35
阅读次数:
207
二分+SPFA找负环
11090 - Going in Cycle!!
Time limit: 3.000 seconds
#include
#include
#include
#include
#include
using namespace std;
const double INF=1000000000.;
struc...
分类:
其他好文 时间:
2014-07-02 08:30:41
阅读次数:
216
Sort a linked list in O(n log n)
time using constant space complexity.
看到O(n log n)的排序算法,适合单链表的首先想到的就是归并排序
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* Lis...
分类:
其他好文 时间:
2014-07-02 08:47:34
阅读次数:
239
实现浮点类型的幂运算,函数原型为:
double pow(double x, int n)
在求解这个问题的时候是一个很挣扎的过程,因为它不是报错而是一直提示你超出时间,那么必须一次次的考虑怎样降低时间复杂度。
首先最直接的思路是下面这样的,就跟直观的数学求解一样。
double pow(double x, int n)
{
if(n==0)
return 1.0;
...
分类:
其他好文 时间:
2014-07-02 09:21:49
阅读次数:
179
新开通的博客地址,内容会慢慢的丰富起来,希望大家能够持续关注...
分类:
其他好文 时间:
2014-07-02 08:18:29
阅读次数:
186
第1章 软件测试概述
什么是软件测试
ü 广义的概念:指软件生存周期中所有的检查、评审和确认工作,其中包括了对分析、设计阶段,以及完成开发后维护阶段的各类文档、代码的审查和确认
ü 狭义概念:识别软件缺陷的过程,即实际结果与预期结果的不一致
ü 软件测试通常包括验证(verification)和确认(validation):
- 验证指保证软件正确的实现了某一特定功能的一系...
分类:
其他好文 时间:
2014-07-02 07:08:27
阅读次数:
289
一. maven坐标
1. 什么是坐标?
在平面几何中坐标(x,y)可以标识平面中唯一的一点
2. maven坐标主要组成:
a.) groupId:定义当前Maven项目隶属项目
b.) artifactId:定义实际项目中的一个模块
c.) version:定义当前项目的当前版本
d.) packaging:定义该项目的打包方式
3. mave...
分类:
其他好文 时间:
2014-07-02 07:39:25
阅读次数:
231
题目:最近点对(大数据)。
分析:分治法。首先,将所有点按很坐标排序;然后,利用分治求解。
1.将问题转化为两个相同大小的子区间分别求解;
2.中位点为中心,当前最小距离为半径的区间直接枚举求解;
3.求出上两中情况的最小值返回。
说明:这么经典的题目,今天第一次做。
#include
#include
#in...
分类:
其他好文 时间:
2014-07-02 09:41:14
阅读次数:
202
这里我们主要想讲解冈萨雷斯的数字图像处理这本书上膨胀腐蚀的定义及用opencv实现的结果,然后对比它们之间的差异。
一:opencv实现
在这之前可以看我的另外一篇blog:
膨胀:
案例代码:
int main()
{
int a[8][8] = {
{0,0,0,0,0,0,0,0},
{0,0,5,1,0,0,1,1},
{0,1,0,1,0,1,0...
分类:
其他好文 时间:
2014-07-02 08:30:04
阅读次数:
146
最近公司使用sencha touch开发app需要实现推送的功能,本渣花了一周的时间才把安卓和ios都实现了推送已经跳转页面的功能。晚上关于推送的资料很少,关于推送后页面跳转的资料就更少了,所以这里记录一下怕以后忘了。
首先是安卓的实现方式(首先需要在极光推送上面去注册一个账号):
1:用sencha CMD创建st应用:
sencha -sdk D:\java\sencha-touc...
分类:
其他好文 时间:
2014-07-02 08:29:20
阅读次数:
275
NSString,NSMutableString,NSArray,NSMutableArray,NSDictionary,NSMutableDictionary 在 OC 中我们天天都要用,而我们要怎么学习它们呢?
我认为学习这些常用的类,使用类比的方法就行了,只要学会一个类,就能类比另外两个类了..
比如,NSString和NSMutableString的可变与不可变...
分类:
其他好文 时间:
2014-07-02 07:31:08
阅读次数:
149
题目,求一个连续的数组,最大连续和。
(一)O(n3)算法:
利用穷举法的思想,这种方法的效率最差。
代码如下:
#include
#include
#include
#include
using namespace std;
const int MAXN = 1000;
int A[MAXN], n;
int maxsum(int *A, int n) {
int beat...
分类:
其他好文 时间:
2014-07-02 09:15:50
阅读次数:
349