随笔分类 -  BFS

摘要:link class Solution { public: struct State{ int mpos; int cpos; int turn; int win; State(int m, int c, int t, int w){ mpos=m; cpos=c; turn=t; win=w; } 阅读全文
posted @ 2021-01-18 12:16 feibilun 阅读(86) 评论(0) 推荐(0)
摘要:link #include <bits/stdc++.h> # define LL long long using namespace std; struct Edge{ int to; int next; }e1[500010], e2[500010]; int head1[100010]; in 阅读全文
posted @ 2020-05-18 11:02 feibilun 阅读(182) 评论(0) 推荐(0)
摘要:link Solution 1 : min cost flow Break each cell into two nodes i and i', connect i to i' (i+mn) with an edge with flow 1, cost 0. For each cell i, con 阅读全文
posted @ 2020-03-01 15:06 feibilun 阅读(170) 评论(0) 推荐(0)
摘要:Link class Solution { public: int ladderLength(string beginWord, string endWord, vector<string>& wordList) { unordered_set<string> words; for(auto &s: 阅读全文
posted @ 2020-02-09 09:53 feibilun 阅读(170) 评论(0) 推荐(0)
摘要:link class Solution { public: vector<vector<string>> findLadders(string beginWord, string endWord, vector<string>& wordList) { vector<vector<string>> 阅读全文
posted @ 2020-02-09 09:20 feibilun 阅读(123) 评论(0) 推荐(0)