Problem Description
You are given a tree, it’s root is p, and the node is numbered from 1 to n. Now define f(i) as the number of nodes whose number is less than i in all the succeeding nodes of nod...
分类:
编程语言 时间:
2015-06-23 23:14:09
阅读次数:
190
A message containing letters from A-Z is being encoded to numbers using the following mapping:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine the total number of ways to...
分类:
其他好文 时间:
2015-06-23 23:10:22
阅读次数:
196
Leetcode 01 Two SumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return in...
分类:
其他好文 时间:
2015-06-23 23:04:42
阅读次数:
126
url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址。type: 要求为String类型的参数,请求方式(post或get)默认为get。注意其他http请求方法,例如put和delete也可以使用,但仅部分浏览器支持。timeout: 要求为Number类型的参数,设置请求超...
分类:
Web程序 时间:
2015-06-23 22:56:33
阅读次数:
147
Description
Farmer John's cows have discovered that the clover growing along the ridge of the hill (which we can think of as a one-dimensional number line) in his field is particularly good.
...
分类:
编程语言 时间:
2015-06-23 21:41:15
阅读次数:
155
This is a typical problem aboutsearching. In fact, you can use either BFS or DFS for it. Personally, I use BFS because I think it is more intuitive an...
分类:
其他好文 时间:
2015-06-23 21:27:19
阅读次数:
90
NEURAL NETWORKS, PART 2: THE NEURONA neuron is a very basic classifier. It takes a number of input signals (a feature vector) and outputs a single val...
分类:
Web程序 时间:
2015-06-23 20:02:59
阅读次数:
196
1.存储目录中的文件信息(文件名、扩展名等等)#include struct dirent{ long d_ino; /* inode number 索引节点号 */ off_t d_off; /* offset to this dirent 在目录文件中的偏移 */ unsigned short ...
分类:
其他好文 时间:
2015-06-23 19:59:30
阅读次数:
124
题目:判断一个数是不是回文数Determine whether an integer is a palindrome. Do this without extra space.思路:借助上一道求整数逆序的思路,判断逆序后的数和原数是否相等就行。要注意,负数都不是回文数11506 / 11506 te...
分类:
其他好文 时间:
2015-06-23 19:48:42
阅读次数:
111
唉………………写的相当的乱,状态十分不好。
可以求每个数前面有多少个magic number,然后相减即可。
#include
#include
using namespace std;
int num(int x)
{
int sum=0;
while(x>0)
{
sum++;
x/=10;
}
return su...
分类:
其他好文 时间:
2015-06-23 18:06:47
阅读次数:
92