/* The notification name */const NSString *ResultOfAppendingTwoStringsNotification =@"ResultOfAppendingTwoStringsNotification"; /* Keys inside the dic...
分类:
移动开发 时间:
2014-06-27 20:38:41
阅读次数:
229
二分查找法是针对已经排好序的序列进行查找每次折半查找算法时间复杂度,对于长度为N的序列,每次执行N/2,假设k次结束,最后到第一个N/2^k=0,所以k=logN时间复杂度logNint binarysearch(const int array[], int x, int N) { int l...
分类:
其他好文 时间:
2014-06-27 20:33:28
阅读次数:
178
1 private const int SC_SCREENSAVE = 0xF140;2 private const int WM_QUERYENDSESSION = 0x0011;3 private bool IsScreenSave = false;4 ...
1,cout 1) 用来向标准输出打印。 2)如果参数是char*类型,则直接输出字符串。如果想要输出地址,则需要强制转换: (const_cast(pstr));2,cin 1) 将标准输入读入变量,如果输入与变量声明类型不一致,则cin为false,可以用if判断,变量值不确定。 do...
分类:
编程语言 时间:
2014-06-26 19:07:54
阅读次数:
211
sscanf函数sscanf函数基本知识函数原型int sscanf( const char *buffer, const char *format [, argument ] ... );函数功能将buffer中的数据按照format格式读取后存储在argument中,返回值表示为成功转换的的数据...
分类:
其他好文 时间:
2014-06-26 15:49:14
阅读次数:
160
756 - Biorhythms
题目链接
基本就是裸的中国剩余定理。
代码:
#include
#include
const int M = 23 * 28 * 33;
const int m[3] = {23, 28, 33};
int p[3], d;
int gcd(int a, int b, int &x, int &y) {
if (!b) {x = ...
分类:
其他好文 时间:
2014-06-26 14:30:56
阅读次数:
287
UVA 10692 - Huge Mods
题目链接
题意:求a0a1a2...mod m
思路:直接算肯定不行,利用欧拉定理ab=a(b mod phi(m) + phi(m))(b>=phi(m)),对指数进行降值处理,然后就可以利用快速幂去计算了,计算过程利用递归求解。
代码:
#include
#include
const int N = 1005;
i...
分类:
其他好文 时间:
2014-06-26 11:43:20
阅读次数:
290
才学疏浅,只言片语,只求志同道的朋友一起交流研究。
并行化不算是算法的改进,只是追求运行的实时性。
简要列举一个例子:
TLD算法的C++版本源码里:
LKTracker::trackf2f(const Mat& img1, const Mat& img2,vector &points1, vector &points2){
bool LKT...
分类:
其他好文 时间:
2014-06-26 07:33:40
阅读次数:
183
题目链接:hdu 4828 Grids
题目大意:略。
解题思路:将上一行看成是入栈,下一行看成是出栈,那么执着的方案就是卡特兰数,用递推的方式求解。
#include
#include
typedef long long ll;
const int N = 1000005;
const ll MOD = 1e9+7;
ll dp[N];
ll extendGcd(ll a...
分类:
其他好文 时间:
2014-06-26 06:58:03
阅读次数:
197
题目链接:bnu 34895 Elegant String
题目大意:给定n和k,表示有一个长度为n的序列,序列中的元素由0~k组成,问说有多少个串满足不包含0~k的全排列。
解题思路:矩阵快速幂,根据dp[i][j]表示说第i为有j个相同,写出递推式,根据递推式求出矩阵。
#include
#include
typedef long long ll;
const ll MOD...
分类:
其他好文 时间:
2014-06-26 06:54:09
阅读次数:
205