摘要:
```cpp //时间复杂度:O(NM) //动态规划思想 //可以处理负边,可以检测出负环 include include using namespace std; const int maxn=1010, maxm=10010, INF=0x3f3f3f3f; int n, m, s, dis[ 阅读全文
摘要:
```cpp include include include include include using namespace std; typedef pair pii; const int maxn=1e5+5, maxm=2e5+5; struct edge { int t, w; edge n 阅读全文
摘要:
```cpp include include include include using namespace std; const int maxn = 1e4 + 5; int f[maxn]; int n, m; inline int Find(int x) { return f[x] == x 阅读全文
摘要:
空间复杂度:O(N+E) 时间复杂度:O(ElogE) cpp include include include include using namespace std; const int maxn=5e3+5, maxm=2e5+5; int f[maxn], n, m; //f为并查集数组 st 阅读全文
摘要:
```cpp include include include include using namespace std; typedef long long ll; priority_queue, greater a; //greater表示从大到小排序,形成小根堆 //less表示从小到大排序,形成 阅读全文
摘要:
```cpp include include using namespace std; const int maxn=1e5+5; int a[maxn], n; void adjust(int s, int t) { int dad=s; int son=dad 2; while(sona[son 阅读全文