摘要:
class Solution {public: int minimumTotal(vector > &triangle) { if (triangle.size() == 0) return 0; vector f(triangle[triangle.size()-1].size()); f[0] = triangle[0][0]; for(int i = 1; i = 0; j--) if (j == 0) f[j] = f[j] + triangle[i][j]; else if (j == t... 阅读全文
摘要:
class Solution {public: double pow(double x, int n) { double a=1; if(n==0)return 1; if(x==1)return 1; if(x==-1) { if(n&1)return -1; else return 1; } int absn=abs(n); a=power(x,absn); if(n>1); r... 阅读全文
摘要:
dfsclass Solution {public:string str[8]={"abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};vectors; vector letterCombinations(string digits) { s.clear(); dfs(digits,""); return s; } void dfs(string digits,stri 阅读全文