摘要: 超时算法—排序dfs:class Solution {public:string s;string s1;int count; string getPermutation(int n, int k) { s="123456789"; count=0; s1=""; dfs(0,n,k); return s1; } void dfs(int depth,int n,int k) { if(depth==n&&count<=k) { count++... 阅读全文
posted @ 2013-06-02 22:39 代码改变未来 阅读(159) 评论(0) 推荐(0) 编辑
摘要: I一次accept,dfsclass Solution {public:vector<vector<string>>v;vector<string>v1; vector<vector<string>> partition(string s) { v.clear(); if(s.size()==0)return v; v1.clear(); dfs(0,s); return v; } bool ishui(string s) { int i=0,j=s.size()-1;... 阅读全文
posted @ 2013-06-02 18:55 代码改变未来 阅读(204) 评论(0) 推荐(0) 编辑