02 2015 档案
摘要:首先要有个MinGW(我这里借用ceemple的编译器 ,mingw32) 设置环境变量 右击我的电脑,点属性 高级 环境变量。 在系统环境变量在PATH里加入 (具体路径请根据你的MinGW选择); 新建 变量,如果有的话,在值中加入 ; 新建 变量,值设为 ; (可以测试下,cmd g++ v)
阅读全文
摘要:You are given two linked lists representing two non-negative numbers. >Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)>Output: 7 -> 0 -> 8*以下是c++代码*```cpp/** * D...
阅读全文
摘要:**Given an array of integers, find two numbers such that they add up to a specific target number.**Input: numbers={2, 7, 11, 15}, target=9Output: ...
阅读全文
摘要:Given a digit string, return all possible letter combinations that the number could represent.这里用递归,递归式举例:$f(2)=[a,b,c]$, $f(23)=[a+f(3),b+f(3),c+f(3)...
阅读全文
摘要:>anagram,bing词典上的解释是**颠倒字母而成的词句**,例如*"dog"*,*"god"*就是一对anagram;题目的大致意思是:给出一个由string组成的list,返回其中所有的是anagram的string*以下是python代码*```pythonclass Solution:...
阅读全文
摘要:**Pow(x, n)**,计算$x^n$*以下是C++代码*```cppclass Solution {public: double pow(double x, int n) { // 四种不需要计算的情况 if (n == 0||x==1){ return 1; } if (x == ...
阅读全文
摘要:**题目:** 给定两个string $S$、$T$,计算序列为$T$的$S$的子序列的数量。>例如S = "rabbbit", T = "rabbit",返回结果为3>子序列:例如,"ACE"是"ABCDE"的子序列。**这里我用动态规划的来求解*** 构建DP表,大小为 $T.size ...
阅读全文

浙公网安备 33010602011771号