06 2023 档案
摘要:#include <iostream> enum class Color { Red, Black }; template <typename T> struct Node { T key; Node<T>* parent; Node<T>* left; Node<T>* right; Color
阅读全文
摘要:题目链接:[普通二叉树(简化版)](https://www.luogu.com.cn/problem/P5076) ```cpp #include template class ThreadedBinaryTreeNode { public: T data; int count; ThreadedB
阅读全文
摘要:```cpp template struct Node { int l, r; T sum; // 区间和 T addtag; // 加法懒标记 // 左右子节点 Node *left, *right; Node(int l_, int r_, T sum_) : l(l_), r(r_), sum
阅读全文
摘要:## 求强连通分量: ```cpp #include using namespace std; int main() { int n, m; scanf("%d%d", &n, &m); vector> adj(n + 1); for (int i = 0; i dfn(n + 1); // dfs
阅读全文
摘要:```cpp #include using namespace std; int main() { int n, m, s; scanf("%d%d%d", &n, &m, &s); int N = 20; vector> adj(n + 1); for (int i = 1; i dep(n +
阅读全文
摘要:## 二维数组分配: ```cpp #include int main() { int rows = 3; int cols = 4; // 使用二级指针创建一个动态分配的二维数组 int **array = new int*[rows]; for (int i = 0; i #include in
阅读全文
摘要:1.删除每一行的最后一个字符:`:%s/. //`
阅读全文
摘要:#include <iostream> #include <fstream> #include <sstream> int main() { std::ifstream file("in.txt"); if (!file.is_open()) { std::cerr << "can't open f
阅读全文