上一页 1 2 3 4 5 6 7 8 9 10 ··· 25 下一页
摘要: The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the s 阅读全文
posted @ 2018-06-26 18:15 赖兴宇 阅读(136) 评论(0) 推荐(0) 编辑
摘要: A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes 阅读全文
posted @ 2018-06-26 15:58 赖兴宇 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 1053 Path of Equal Weight (30)(30 分) Given a non-empty tree with root R, and with weight W~i~ assigned to each tree node T~i~. The weight of a path fr 阅读全文
posted @ 2018-06-26 14:36 赖兴宇 阅读(120) 评论(0) 推荐(0) 编辑
摘要: vector: 在vc6中,如果要镶嵌使用vector, 如vector<vector<int> >, 后面的两个> 应该用,空格隔开, 否则被编译器认为是移位符 string::npos 的值为-1或者4294967295 string str; str.find(str2) 返回str2第一次在 阅读全文
posted @ 2018-06-25 21:40 赖兴宇 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 最大公约数:辗转相除法, 0和a的最大公因子为a; a和b的最小公倍数: 设a,b的最大公因子为d, 则最小公倍数为ab/d, 但是ab可能会导致溢出,应该先算除法再算乘法,即最小公倍数为a/d*b 分数运算: 用结构体保存分子,分母;为了避免乘法溢出, 分子分母用long long 保存, 满足以 阅读全文
posted @ 2018-06-25 19:43 赖兴宇 阅读(276) 评论(0) 推荐(0) 编辑
摘要: Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p~1~\^k~1~ * p~2~\^k~2~ *…*p~m~\^k~m 阅读全文
posted @ 2018-06-25 19:42 赖兴宇 阅读(652) 评论(0) 推荐(0) 编辑
摘要: rand()能输出的最大随机数是32767, 如果要生成最大的随机数应该采用下面的方法 阅读全文
posted @ 2018-06-25 16:33 赖兴宇 阅读(589) 评论(0) 推荐(0) 编辑
摘要: 给定一句英语,要求你编写程序,将句中所有单词的顺序颠倒输出。 输入格式:测试输入包含一个测试用例,在一行内给出总长度不超过80的字符串。字符串由若干单词和若干空格组成,其中单词是由英文字母(大小写有区分)组成的字符串,单词之间用1个空格分开,输入保证句子末尾没有多余的空格。 输出格式:每个测试用例的 阅读全文
posted @ 2018-06-24 23:39 赖兴宇 阅读(138) 评论(0) 推荐(0) 编辑
摘要: mid=(l+r)/2可能会出错, 应该用mid=l+(r-l)/2; 阅读全文
posted @ 2018-06-24 17:23 赖兴宇 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Note: There may be more than one LIS combination, it 阅读全文
posted @ 2018-06-24 17:11 赖兴宇 阅读(164) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 25 下一页