#include
#include
using namespace std;
//下面一个移位是一样的,>>相当于除去2,主要是要用right-left,否则对于大数据来说会产生溢出问题。切记
int binarySearch(int arr[],int len,int number)
{
int left=0;
int right=len-1;
in...
分类:
其他好文 时间:
2014-05-15 07:14:38
阅读次数:
272
给你两个四位的素数s和t,要求每次改变一个数字,使得改变后的数字也为素数,求s变化到t的最少变化次数。...
分类:
其他好文 时间:
2014-05-15 05:38:25
阅读次数:
234
/*
* hdu How many prime numbers
* date 2014/5/13
* state AC
*/
#include
#include
#include
using namespace std;
bool isPrime(int x)
{
int sqr=sqrt(x*1.0);
for(int i=2;i<=sqr;i++)
{...
分类:
其他好文 时间:
2014-05-15 05:07:18
阅读次数:
261
Write the code that will take a string and make this conversion given a number of rows:
P A H N
A P L S I I G
Y I R
convert("PAYPALISHIRING", 3) should return "PAHNAPLSIIGYIR"....
分类:
其他好文 时间:
2014-05-15 04:49:04
阅读次数:
311
LeetCode-001 Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2...
分类:
其他好文 时间:
2014-05-15 04:34:50
阅读次数:
293
2.6内核
1>修改linux-source-2.6.31/kernel/sys.c文件,在文件末尾添加系统响应函数。函数实现如下:
asmlinkage int sys_mycall(int number)
{
printk("这是我添加的第一个系统调用");
return number;
}
2>在linux-source-2.6.31...
分类:
系统相关 时间:
2014-05-15 02:51:56
阅读次数:
382
【题目】
Determine whether an integer is a palindrome. Do this without extra space.
【题意】
题意判断一个整数是否是回文数
注意一下几点:
1. 不能用额外的空间
2. 负数不是回文数...
分类:
其他好文 时间:
2014-05-14 20:31:10
阅读次数:
298
1、
??
Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S.
A subsequence of a string is a new string which is formed from the original str...
分类:
其他好文 时间:
2014-05-14 20:22:58
阅读次数:
275
大部分数据库都提供了窗口函数,比如RANK,ROW_NUMBER等等。MySQL这方面没有直接提供,但是可以变相的实现,我以前写了row_number的实现,今天有时间把rank的实现贴出来。这里,我用MySQL以及Python分别实现了rank窗口函数。原始表信息:t_girl=#\dgroup_concat;
Table"ytt.grou..
分类:
数据库 时间:
2014-05-14 17:04:57
阅读次数:
442
-------android培训、java培训、期待与您交流!----------MyEclipse相关知识Workspace与project切换工作空间:File---SwitchWorkspace---Other一个工作间包含多个工程,切换工作间之后,会影响里面的工程,例如快捷键什么的都要重新配置如果重新配了之后快捷键还没有用就要考虑..
分类:
其他好文 时间:
2014-05-14 17:01:52
阅读次数:
304