Description给一个1到N的排列{Ai},询问是否存在1y then exit(x);
24 exit(y); 25 end; 26 27 procedure add(x,now:longint); 28 var 29 mid:longint;
30 begin 31 ...
分类:
其他好文 时间:
2014-05-23 03:02:46
阅读次数:
1150
Sum square difference
Problem 6
The sum of the squares of the first ten natural numbers is,
12 + 22 + ... + 102 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ....
分类:
其他好文 时间:
2014-05-23 02:22:57
阅读次数:
193
Smallest multiple
Problem 5
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly di...
分类:
其他好文 时间:
2014-05-23 01:51:13
阅读次数:
261
恢复到最后一次提交的改动:
git
checkout -- + 需要恢复的文件名
但是,需要注意的是,如果该文件已经 add 到暂存队列中,上面的命令就不灵光喽
需要先让这个文件取消暂存:
git
reset HEAD -- + 需要取消暂存的文件名
然后再使用第一条命令。
如果感觉命令多了记不住,那就做一两个匿名呗,比如:
git
config ...
分类:
其他好文 时间:
2014-05-22 23:34:55
阅读次数:
319
Given two binary trees, write a function to
check if they are equal or not.Two binary trees are considered equal if they are
structurally identical an...
分类:
其他好文 时间:
2014-05-22 16:46:03
阅读次数:
173
We added a system call to modify idt table,
then programed it inmodify_idt.c1. Put our modify_idt.c file
in/usr/src/linux-3.10.15/arch/x86/kernel2./us...
分类:
其他好文 时间:
2014-05-22 15:51:03
阅读次数:
269
ALTER TABLE:添加,修改,删除表的列,约束等表的定义。查看列:desc
表名;修改表名:alter table t_book rename to bbb;添加列:alter table 表名 add column 列名
varchar(30);删除列:alter table 表名 drop...
分类:
数据库 时间:
2014-05-22 14:35:02
阅读次数:
379
【题目】
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
The same repeated number may be chosen from C unlimited number of times.
Note:
All numbers (including target) w...
分类:
其他好文 时间:
2014-05-21 15:21:28
阅读次数:
292
【题目】
The count-and-say sequence is the sequence of integers beginning as follows:
1, 11, 21, 1211, 111221, ...
1 is read off as "one 1" or 11.
11 is read off as "two 1s" or 21.
21 is read off as "one 2, then one 1" or 1211.
Given an integer n, generate...
分类:
其他好文 时间:
2014-05-21 15:20:07
阅读次数:
213
【题目】
Given two numbers represented as strings, return multiplication of the numbers as a string.
Note: The numbers can be arbitrarily large and are non-negative.
【题意】
给定用字符串表示的整数,返回两个数的乘积结果字符串。两个数字都非负,且能任意大。
【思路】
1. 考虑其中一个数是0的情况
2. 模拟乘法运算...
分类:
其他好文 时间:
2014-05-21 13:45:37
阅读次数:
214