摘要: class Solution { vector<vector<pair<int,double> > >v; public: double maxProbability(int n, vector<vector<int>>& edges, vector<double>& succProb, int s 阅读全文
posted @ 2020-07-12 21:15 阿破 阅读(191) 评论(0) 推荐(0)
摘要: class Solution { public: int findTheLongestSubstring(string s) { /*需要找到状态为0的子序列[i,j],[i,j]=[0,j]-[0,i](两者状态相同时的差) */ int state=0,ans=0; vector<int> p( 阅读全文
posted @ 2020-07-11 10:15 阿破 阅读(106) 评论(0) 推荐(0)
摘要: class Solution { public: TreeNode* dfs(TreeNode *&root,int target){ if(!root) return root; dfs(root->left,target); dfs(root->right,target); if(root->v 阅读全文
posted @ 2020-07-10 15:23 阿破 阅读(107) 评论(0) 推荐(0)
摘要: class Solution { public: bool canFinish(int numCourses, vector<vector<int>>& prerequisites) { int n=0; queue<int> s; vector<int> h[numCourses],indeg(n 阅读全文
posted @ 2020-07-10 13:27 阿破 阅读(103) 评论(0) 推荐(0)
摘要: class Solution { public: vector<int> gardenNoAdj(int N, vector<vector<int>>& paths) { vector<int> G[N]; for (int i=0; i<paths.size(); i++){//建立邻接表 G[p 阅读全文
posted @ 2020-07-08 18:45 阿破 阅读(139) 评论(0) 推荐(0)
摘要: class Solution { public: ListNode* swapPairs(ListNode* head) { ListNode* res=NULL; if(!head) return res; ListNode* front=head,*back=head->next,*n,*p=n 阅读全文
posted @ 2020-07-07 10:53 阿破 阅读(171) 评论(0) 推荐(0)
摘要: class Solution { public: ListNode* mergeKLists(vector<ListNode*>& lists) { ListNode* head=new ListNode(0),*minval=NULL,*p=head; int n=lists.size(),m=0 阅读全文
posted @ 2020-07-07 10:13 阿破 阅读(116) 评论(0) 推荐(0)
摘要: 备注:记忆化深搜(ms)类似于动态规划,仅递推顺序相反,dp可解,则ms可解 题目:输入两个字符串s,p,p包含字符“ ‘.’ ,'*' ”。点可匹配任意一个字符,星号可匹配零个或多个前一个字符。 eg: s:aaaab p:a*b 输出:true; s:b p:a*b 输出:true; class 阅读全文
posted @ 2020-04-09 13:46 阿破 阅读(145) 评论(0) 推荐(0)
摘要: 宇宙是一根琴弦,生命拨动了它。于是琴弦开始振动。 生命有了意识之后,就在不断问道:"为什么琴弦是以这样的频率而不是那样的频率在振动?" 为了探寻所谓的真理,人们在这根琴弦上探索,于是琴弦的频率开始变化。人们越是在琴弦上探索,这琴弦的旋律就越复杂,越美妙。 千百年来,人们不断发出感叹:"宇宙如此神奇, 阅读全文
posted @ 2019-12-02 17:53 阿破 阅读(212) 评论(0) 推荐(0)
摘要: 1.安装TDM-GCC-64 配置好环境变量 2.使用matlab安装包,安装Microsoft Windows SDK以Matlab Compiler 3.在matlab中 使用 mex -setup 以及mbuild -setup配置好编译器环境 4. 执行语句:“setenv('MW_MING 阅读全文
posted @ 2019-11-29 15:36 阿破 阅读(2302) 评论(0) 推荐(0)