Commit b55d7630 by yaozc

### keep going

parent 27539330
 ... ... @@ -851,6 +851,17 @@ public: Cut Off Trees for Golf Event //这题凉了，很接近了但是tle解决不了 class Solution { public: int cutOffTree(vector>& forest) { ... ... @@ -908,7 +919,7 @@ public: pair curr = q.front(); q.pop(); visited[curr.first][curr.second] = true; if(curr.first!=dest.first || curr.second!=dest.second) total_steps++; if(curr.first==dest.first || curr.second!=dest.second) total_steps++; else {return total_steps;} //left one if(curr.first-1>0 && forest[curr.first-1][curr.second]>1 && !visited[curr.first-1][curr.second]) ... ... @@ -927,49 +938,6 @@ public: } }; // /*#include #include #include ... ... @@ -1066,4 +1034,105 @@ cout< dia = {"0", "1", "abc", "def", "ghi", "jkl", "nmo", "pqrs", "tuv", "wxyz" }; vector letterCombinations(string digits) { vector res; if(digits=="") return res; helper(res, 0, "", digits); return res; } void helper(vector ¤t, int used_digit, string current_word, string digits){ if(used_digit == digits.size()){ current.push_back(current_word); return; } else{ int current_digit = digits[used_digit]-'0'; for(int i=0; i generateParenthesis(int n) { vector res; if(n==0) return res; vector all_parentheses; for(int i=0; i& res, string current_res, int current_used, vector& all_parentheses){ if(current_used == all_parentheses.size()) res.push_back(current_res); else{ for(int i=0; i
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!