该文被密码保护。 阅读全文
摘要:
${\LARGE \mathcal{SPFA} } $ #include <bits/stdc++.h> #define otto auto using namespace std; struct edge { int v, w; // v --> to, w --> value }; const 阅读全文
摘要:
并查集 在类似于“朋友的朋友是朋友,敌人的敌人是朋友”的题目中,我们考虑并查集。 我们可以利用反集来更加优雅的实现“敌人的敌人是朋友”。 将原长为 \(n\) 的数组开到 \(2n\)。 如果 \(a\) 和 \(b\) 是敌人,合并 \(n+b\) 和 \(a\) ,\(n+a\) 和 \(b\) 阅读全文
该文被密码保护。 阅读全文