摘要: class Solution { public: vector<vector<int>> res; vector<int> path; bool st[10]; void dfs(vector<int>& nums,int u) { int n=nums.size(); if(u==n) { res 阅读全文
posted @ 2023-04-15 20:31 穿过雾的阴霾 阅读(22) 评论(0) 推荐(0)
摘要: class Solution { public: int moreThanHalfNum_Solution(vector<int>& nums) { int cnt=0,val=-1;//val给一个无效值即可 for(auto x:nums) { if(!cnt)//投票最多人没了,接下来任何人都 阅读全文
posted @ 2023-04-15 20:31 穿过雾的阴霾 阅读(19) 评论(0) 推荐(0)
摘要: class Solution { public: long long f[1010][1010];//f[i][j]表示s前i个字符得到t前j个字符的所有方案 int numDistinct(string s, string t) { f[0][0]=1; int n=s.size(),m=t.si 阅读全文
posted @ 2023-04-15 14:29 穿过雾的阴霾 阅读(13) 评论(0) 推荐(0)