摘要:
class UnionFindSet { private: int *pref; int *rank; int capacity; public: UnionFindSet(int n) { if (n = c... 阅读全文
摘要:
#include #include #include #include using namespace std;typedef pair P;int main() { // zero means no connection int graph[5][5] = { ... 阅读全文
摘要:
单源最短路径算法Bellman-ford练习,可以处理有负边的情况(也可以在存在负圈时及时终止)#include #include #include using namespace std;class Edge {public: int from; int to; int cost... 阅读全文
摘要:
#include #include using namespace std;class BinaryIndexedTree {private: int *mem; int capacity;public: BinaryIndexedTree (int n) { if ... 阅读全文